most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
// instead of this: | |
if( foo ) { | |
if( bar ) { | |
doSomething(); | |
} else { | |
errorHandling(); | |
} | |
} else { | |
errorHandling(); | |
} |
var SITE = SITE || {}; | |
SITE.fileInputs = function() { | |
var $this = $(this), | |
$val = $this.val(), | |
valArray = $val.split('\\'), | |
newVal = valArray[valArray.length-1], | |
$button = $this.siblings('.button'), | |
$fakeFile = $this.siblings('.file-holder'); | |
if(newVal !== '') { |
// original | |
for(e,l='article aside footer header nav section time'.split(' ');e=l.pop();document.createElement(e)) | |
// original + moved pop | |
for(l='article aside footer header nav section time'.split(' ');;document.createElement(l.pop())) | |
// mine (not tested! might need some braces...) | |
// v1 (no globals) | |
var l=['article','aside','footer','header','nav','section','time'];for(var i in l)document.createElement(l[i]) |
# See the following for references: | |
# * http://www.metacircus.com/hacking/2011/02/18/play-git-like-a-violin.html | |
# * http://cheat.errtheblog.com/s/git/ | |
# * http://pyrtsa.posterous.com/aligning-your-git-logs | |
# * http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ | |
# Git >v1.7.10 lets you include external files | |
# Put your user configuration in here, so it never | |
# accidentally gets checked in | |
[include] |
iPad | |
1024 × 690 In landscape on iOS 4.3 | |
1024 × 672 In landscape on iOS 5 | |
768 × 946 In portrait on iOS 4.3 | |
768 × 928 In portrait on iOS 5 | |
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |
wget http://pecl.php.net/get/xhprof-0.9.2.tgz | |
tar -xzf xhprof-0.9.2.tgz | |
cd xhprof-0.9.2/extension | |
/Applications/MAMP/bin/php/php5.3.6/bin/phpize | |
./configure | |
make | |
cp modules/xhprof.so $(/Applications/MAMP/bin/php/php5.3.6/bin/php-config --extension-dir)/ | |
echo "extension=xhprof.so" >> /Applications/MAMP/bin/php/php5.3.6/conf/php.ini |
#!/bin/bash | |
# Script for placing sudoers.d files with syntax-checking | |
if [ -z "$1" ]; then | |
# Making a temporary file to contain the sudoers-changes to be pre-checked | |
TMP=$(mktemp) | |
cat > $TMP <<EOF | |
Cmnd_Alias VAGRANT_EXPORTS_ADD = /bin/su root -c echo '*' >> /etc/exports | |
Cmnd_Alias VAGRANT_NFSD = /etc/init.d/nfs-kernel-server restart | |
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -e /*/ d -ibak /etc/exports |
<script> | |
// Break out of an iframe, if someone shoves your site | |
// into one of those silly top-bar URL shortener things. | |
// | |
// Passing `this` and re-aliasing as `window` ensures | |
// that the window object hasn't been overwritten. | |
// | |
// Example: | |
// var window = 'haha, punked!'; |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.