This file contains 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
// thx: https://github.com/bcherry/twitter-text-js/blob/master/twitter-text.js | |
var stringSupplant = function(str, values) { | |
return str.replace(/#\{(\w+)\}/g, function(match, name) { | |
return values[name] || ""; | |
}); | |
}; |
This file contains 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 supplant(s, o) { | |
return s.replace(/\{([^{}]*)\}/g, | |
function (a, b) { | |
var r = o[b]; | |
return typeof r === 'string' || typeof r === 'number' ? r : a; | |
} | |
); | |
} |
This file contains 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
#! /usr/bin/env python | |
# The Delicious API only returns 1000 bookmarks at a time. | |
# The web export returns them all in a single file. | |
# This script uses the latter to back up your bookmarks. | |
# | |
# To use: | |
# 1. Install requests: http://python-requests.org | |
# 2. Substitute your username and password below | |
# 3. Run and enjoy! |
This file contains 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/sh | |
wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/microcore-current.iso | |
wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/distribution_files/microcore64.gz | |
wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/distribution_files/vmlinuz64 | |
# extract files | |
7z x microcore-current.iso -omicrocore-current | |
rm -rf microcore-current/[BOOT] | |
chmod 744 microcore-current/boot/isolinux/isolinux.bin |
This file contains 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
if (typeof String.prototype.supplant !== 'function') { | |
String.prototype.supplant = function (o) { | |
return this.replace(/{([^{}]*)}/g, | |
function (a, b) { | |
var r = o[b]; | |
return typeof r === 'string' ? r : a; | |
}); | |
}; | |
} |
This file contains 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 | |
BACKUP_DIR="/var/db/backups" | |
PGUSER="postgres" | |
IGNORE_DATABASES=" | |
postgres | |
template0 | |
template1 | |
" |
This file contains 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
#!/usr/bin/env bash | |
# | |
# url : https://gist.github.com/672684 | |
# version : 2.0.2 | |
# name : appify | |
# description : Create the simplest possible mac app from a shell script. | |
# usage : cat my-script.sh | appify MyApp | |
# platform : Mac OS X | |
# author : Thomas Aylott <oblivious@subtlegradient.com> |
This file contains 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
# Get a web page and store in a local file | |
curl -o thatpage.html http://www.netscape.com/ |
This file contains 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/sh | |
# Dropbox setup on a headless Ubuntu Server | |
# Script written by Jesse B. Hannah (http://jbhannah.net) <jesse@jbhannah.net> | |
# Based on http://wiki.dropbox.com/TipsAndTricks/UbuntuServerInstall | |
### | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains 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
# Instructions for setting up a remote repo on Dropbox | |
# Assuming project/repo called 'myrepo' | |
cd ~/Dropbox | |
mkdir -p git/myrepo.git | |
cd !$ | |
git --bare init | |
cd ~/development/uhy/myrepo | |
git remote add dropbox file://$HOME/Dropbox/git/myrepo.git |
NewerOlder