Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# A bunch of the stuff above relies on this, especially the aliases. | |
[user] | |
# you probably want to change this bit. | |
name = isaacs | |
email = i@izs.me | |
signingkey = 0x6C481CF6 | |
[alias] | |
ci = commit | |
st = status | |
br = branch |
/* | |
* Abstraction.js | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Licensed under the MIT license. | |
* http://benalman.com/about/license/ | |
*/ | |
var Abstraction = (function($) { | |
var _ = $.prototype; |
/* | |
In a child process, each of the stdio streams may be set to | |
one of the following: | |
1. A new file descriptor in the child, dup2'ed to the parent and | |
exposed to JS as a Stream object. | |
2. A copy of a file descriptor from the parent, with no other | |
added magical stuff. | |
3. A black hole - no pipe created. |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
#Completed tasks (showing their title, start date, completion date and time to complete in days) | |
sqlite3 -csv -header ~/Library/Application\ Support/Cultured\ Code/Things\ beta/ThingsLibrary.db "SELECT | |
substr(ZTITLE,0,26) as title, | |
datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime') as startdate, | |
datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime') as completeddate, | |
round(julianday(datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime')) - julianday | |
(datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime')),5) as age | |
FROM ZTHING WHERE ZSTATUS = 3 ORDER BY completeddate; |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#Mobile Device Detection via User Agent RegEx
Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.
I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.
The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".
Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(
#!/bin/bash | |
# /etc/init.d/xvfb_daemon | |
# Xvfb startup script. | |
# Tom Meier <tom@venombytes.com> | |
# | |
### BEGIN INIT INFO | |
# Provides: xvfb | |
# Short-Description: Start/stop/restart daemon | |
# Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server | |
# Example Use: |