Skip to content

Instantly share code, notes, and snippets.

View crsven's full-sized avatar

Chris Svenningsen crsven

View GitHub Profile
{"name":"Hello World","description":"My first widget.json.","data":{"content_url":"https://wd.gt/"},"layouts":{"hello_small":{"size":"small","styles":{"colors":{"primary":"#839073"}},"layers":[{"rows":[{"height":12,"cells":[{"width":12,"background_color_style":"primary","text":{"string":"hello world"}}]}]}]}}}
@crsven
crsven / install-sort-precommit.sh
Last active June 23, 2021 07:29
Sorting XCode project file
#!/bin/bash
GIT_ROOT=$(git rev-parse --show-toplevel)
HOOKS_PATH=$(git rev-parse --git-dir)/hooks
if [ ! -d "$HOOKS_PATH" ]; then
mkdir $HOOKS_PATH
fi
ln -s -f $GIT_ROOT/scripts/sort-project-file.sh $HOOKS_PATH/pre-commit
chmod 555 $HOOKS_PATH/pre-commit
echo "pre-commit hook installed!"
@crsven
crsven / keybase.md
Created December 19, 2016 05:57
keybase.md

Keybase proof

I hereby claim:

  • I am crsven on github.
  • I am crsven (https://keybase.io/crsven) on keybase.
  • I have a public key whose fingerprint is 6408 578A 97C1 594A 6B59 CA99 4382 0658 B0E3 8671

To claim this, I am signing this object:

@crsven
crsven / gist:fbe288562427ab2681f2
Created September 30, 2014 15:55
tilde.club introduction
Hello. You now have a user account on the http://tilde.club world wide web server. This is the dumbest thing I have ever done. Welcome!
An email with your password and username should have arrived by now. It is INCREDIBLY INCREDIBLY LIKELY that it went into your spam folder. It will have come from root@tilde.club. If it didn't arrive you can send me an email and tell me so. I don't mind. Give it a couple hours.
Who am I? I am the system administrator, Paul Ford. Like any system administrator, I will be slow to respond, will get everything wrong, and will act imperiously while never acknowledging wrongdoing. Consider this part of your authentic tilde.club experience!
NEW USER TUTORIAL
tilde.club is just a tiny tiny server running linux on the amazon cloud. Using tilde.club requires you to understand shells and ssh. If you don't know about those things, consider this a challenge and opportunity to learn! This concludes the tutorial.
@crsven
crsven / git-out
Created September 17, 2013 00:22
Git Out like HG
#!/bin/bash
CURRENT_BRANCH=$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "$(git branch | grep '^*' |sed s/\*\ //)"; fi)
if [ "${CURRENT_BRANCH}" != "" ]; then
TARGET="${1}"
if [ "${TARGET}" == "" ]; then
TRACKING_REPOSITORY="$(git config branch.${CURRENT_BRANCH}.remote)"
@crsven
crsven / git-in
Created September 17, 2013 00:21
Git In like HG
#!/bin/bash
CURRENT_BRANCH=$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "$(git branch | grep '^*' |sed s/\*\ //)"; fi)
if [ "${CURRENT_BRANCH}" != "" ]; then
TARGET="${1}"
if [ "${TARGET}" == "" ]; then
TRACKING_REPOSITORY="$(git config branch.${CURRENT_BRANCH}.remote)"
@crsven
crsven / dirfor
Last active December 15, 2015 01:08
Finds directories in use by a given process name. Useful for killing a specific out of control process.
# Usage:
# dirfor ruby
# dirfor vim
#
ps -axc |
awk "/$1/"'{print $1}' |
xargs -L1 lsof -p |
awk '/DIR/ { pids[$2] = $NF }
END {
for (pid in pids)
@crsven
crsven / gist:3828838
Created October 3, 2012 18:30
Cascading font declarations
#my_thing {
font: Ypx 'B';
font: Xpx 'A';
}