Skip to content

Instantly share code, notes, and snippets.

View darkwebdev's full-sized avatar

Timur Manyanov darkwebdev

  • eBay
  • Berlin, Germany
View GitHub Profile
@darkwebdev
darkwebdev / statusline-command.sh
Created August 22, 2026 12:28
Claude Code status line: model + stacked 5h/7d rate-limit bars (usage/time-elapsed) + context usage bar
#!/bin/bash
# Status line: model + progress bars for 5h/7d rate-limit usage and context
# window usage. Reads the JSON payload Claude Code pipes on stdin (see
# `claude` status line docs).
# Force C numeric formatting: a locale with a comma decimal separator (e.g.
# de_DE) makes printf/awk's %f reject or mis-render plain decimal input.
export LC_NUMERIC=C
input=$(cat)
model=$(echo "$input" | jq -r '.model.display_name // "?"')
@darkwebdev
darkwebdev / args.js
Last active September 13, 2019 13:09
Convert script arguments to an object (ES6)
const longArgs = arg => {
const [ key, value ] = arg.split('=');
return { [key.slice(2)]: value || true }
};
const flags = arg => [...arg.slice(1)].reduce((flagObj, f) => ({ ...flagObj, [f]: true }), {});
module.exports = () =>
process.argv
.slice(2)
module.exports = (...args) =>
args.reduce((instance, arg) => ({
...instance,
[arg]: Symbol(arg)
}), {})
@darkwebdev
darkwebdev / SassMeister-input.scss
Created July 31, 2014 11:45
Generated by SassMeister.com.
// ----
// Sass (v3.3.12)
// Compass (v1.0.0.alpha.21)
// ----
.class1 {
color: red;
}
.class2 {
font-size: 16px;
@darkwebdev
darkwebdev / gist:8333886
Created January 9, 2014 13:10
CSS (generated from SCSS) from debug version of Kinofé client. All comments removed.
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
@darkwebdev
darkwebdev / gist:8333799
Last active January 2, 2016 16:59
HTML code (generated from Jade templates) from debug version of Kinofé client. Scripts are not concatenated together and dynamically injected inline styles exist.
<!DOCTYPE html>
<!--[if lt IE 8]>
<html class="no-js lt-ie9 lt-ie8">
<![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9">
<![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->