This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run() { | |
function valueToLabel(value) { | |
console.log("value = " + value); | |
let label = value; | |
if (value === Infinity) { | |
label = "∞"; | |
} else if (value >= 1000000) { | |
label = (value / 1000000).toFixed(1) + 'M'; | |
} else if (value >= 1000) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasDotNet(text) { | |
return text.match(/.NET|[\s^]\.net/) !== null; | |
} | |
function test(expected, text) { | |
let rv = hasDotNet(text); | |
if (expected !== rv) { | |
console.log(`expected ${expected}, but got ${rv} = ${text}`); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"feeds": [ | |
{ | |
"uri": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/with-friends", | |
"cid": "bafyreif6l6b2vo5x24q6f6kzzdm7pl3g3fsrppslogkubru5vvbrt56bmm", | |
"did": "did:plc:5fllqkujj6kqp5izd5jg7gox", | |
"creator": { | |
"did": "did:plc:z72i7hdynmk6r22z27h6tvur", | |
"handle": "bsky.app", | |
"displayName": "Bluesky", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
icon.iconset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# gdz = git diff fzf | |
files=$(git status -s | grep ' M' | awk '{print $NF}') | |
if [ -n "${files}" ]; then | |
file=$(echo "$files" | fzf) | |
if [ -n "${file} " ]; then | |
root=$(git rev-parse --show-toplevel) | |
cmd="${EDITOR} ${root}/${file}" |

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy the gem location to clipboard | |
bundle show yajl-ruby | pbcopy | |
# Example: /Users/gedrovits/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/yajl-ruby-0.8.2 | |
cd <cmd + v> | |
cd ext/yajl | |
# Now we need to replace 'inline void' to 'static void'. This will also create backup of old files. | |
sed -i '.bak' 's/inline void/static void/g' yajl_ext.h yajl_ext.c | |
# Now we must rebuild changed extension | |
make clean all | |
# After this you should not have any problems with yajl-ruby |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# If there is a first argument and expansions do not match | |
if [ -n "$1" ] && [ ! -f "$1" ] && [ "$(echo $1*)" != "$1*" ]; then | |
echo "There are completions!: "$(echo $1*) | |
exit 1 | |
else | |
$EDITOR $@ | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat transcript | pbcopy | |
$ ./slackpaste.rb | |
alice: this is a test | |
alice: this is another line from alice | |
bob: this is bob chiming in | |
jerry: this is tomorrow! | |
jerry: another graet line from jerry | |
$ ./slackpaste.rb -x | |
$ pbpaste | |
alice: this is a test |
NewerOlder