Skip to content

Instantly share code, notes, and snippets.

View jcsalterego's full-sized avatar

Jerry Chen jcsalterego

View GitHub Profile
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 {
{
"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",
@jcsalterego
jcsalterego / README.md
Last active May 15, 2023 18:33
vibes only

@jcsalterego
jcsalterego / .gitignore
Last active December 14, 2023 16:59
Bluesky Icon
icon.iconset
#!/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}"
@jcsalterego
jcsalterego / how-to-fix-on-mac.sh
Created December 12, 2017 18:45 — forked from Gedrovits/how-to-fix-on-mac.sh
How to fix 'dyld: lazy symbol binding failed: Symbol not found: _yajl_set_static_value'
# 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
#!/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
@jcsalterego
jcsalterego / example.txt
Created November 23, 2016 23:51
Slack Paste
$ 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
@jcsalterego
jcsalterego / script.sh
Last active August 29, 2015 14:16
sadhax
$ cat script.sh | bash -c 'cat - >/tmp/$$.sh; bash /tmp/$$.sh $@; rm -f /tmp/$$.sh' -- -v foobar
args are -v foobar