⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 ruby -wKU | |
# This program scans your ethers file to generate a valid dhcpd.conf file | |
# (or at least a segment of one). In addition, it will read your hosts file | |
# to see if there are any known aliases it can add. It then prints the | |
# formatted results to standard out. | |
# | |
# Author:: Dana Merrick (mailto:[email protected]) | |
# Copyright:: Copyright (c) 2009 Dana Merrick | |
# License:: Released under the MIT license |
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/ruby | |
# as of 20100101 requires the latest yajl-ruby | |
# http://github.com/brianmario/yajl-ruby | |
require 'rubygems' | |
require "yajl/http_stream" | |
require 'em-http' | |
require 'mq' |
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 ruby | |
# Dynamic DNS updater by Andruby for Zerigo | |
# www.andrewsblog.org | |
ApiKey = 'myzerigoapikey' # your Zerigo API key | |
Host = 'test.example.com' # the host you want to dynamically update | |
User = '[email protected]' # your Zerigo username | |
NameServer = 'a.ns.zerigo.net' # Zerigo nameserver to query | |
LastIpTmpFile = '/tmp/dyn_update_last_ip' # a temporary file where we store the last ip adress |
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
require 'rubygems' | |
require 'hmac-sha1' # on OS X: sudo gem install ruby-hmac | |
require 'net/https' | |
require 'base64' | |
# | |
# CHANGE ME: S3 access credentials go here, along with CloudFront Distribution ID | |
# | |
s3_access='' | |
s3_secret='' |
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
1. Go to the app directory | |
cd /Applications/Google\ Chrome.app/Contents/MacOS/ | |
2. Rename the app to app.orig | |
mv Google\ Chrome Google\ Chrome.orig | |
3. Create a shell script with the original name that uses the args you want |
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
server { | |
listen 80; | |
server_name localhost; | |
# ... other default site stuff, document root, etc. ... | |
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ { | |
alias /home/$userdir_user/public_html$userdir_uri; | |
index index.html index.htm index.php; | |
autoindex on; |
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
location /resize { | |
alias /tmp/nginx/resize; | |
set $width 150; | |
set $height 100; | |
set $dimens ""; | |
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
set $width $1; | |
set $height $2; | |
set $image_path $3; |
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
## Canonical redirect for Apache | |
# BEGIN Canonical Redirect | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] ## will match any domain that's not our main domain | |
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] | |
</IfModule> | |
# END Canonical Redirect |
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 | |
# | |
# Totally basic script to rip audiobook CDs into a single file. | |
# I then use Audiobookbinder to create .m4b files so I can listen to them | |
# on my iPhone | |
# | |
# You'll need to: | |
# brew install cdparanoia | |
# brew install shntool | |
# brew install lame |
OlderNewer