Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/bash | |
# use AMI ami-04c9306d | |
# run this script as root. | |
## EDIT | |
export S3_BUCKET="heroku-buildpack-php-tyler" | |
export LIBMCRYPT_VERSION="2.5.8" | |
export PHP_VERSION="5.4.1" | |
export APC_VERSION="3.1.10" | |
export PHPREDIS_VERSION="2.2.1" |
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
http = require('http'); | |
url = require('url'); | |
http.createServer(function(req, res){ | |
var requestURL = url.parse(req.url, true)['pathname']; | |
if (requestURL == '/log.gif') { | |
var imgHex = '47494638396101000100800000dbdfef00000021f90401000000002c00000000010001000002024401003b'; | |
var imgBinary = new Buffer(imgHex, 'hex'); | |
res.writeHead(200, {'Content-Type': 'image/gif' }); |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
# encoding: utf-8 | |
import sublime, sublime_plugin | |
class DetectSpecialCharacters(sublime_plugin.EventListener): | |
def on_load(self, view): | |
sublime.status_message("detect_special_characters is active") | |
def on_modified(self, view): | |
# find no-break space | |
special_characters = view.find_all(u"\u00A0") |
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; |
var dgram = require('dgram'); | |
var socket = dgram.createSocket('udp4'); | |
var testMessage = "[hello world] pid: " + process.pid; | |
var broadcastAddress = '255.255.255.255'; | |
var broadcastPort = 5555; | |
socket.setBroadcast(true); | |
socket.bind(broadcastPort, '0.0.0.0'); |
{ | |
// The number of spaces a tab is considered equal to | |
"tab_size": 2, | |
// Set to true to insert spaces when tab is pressed | |
"translate_tabs_to_spaces": true, | |
"font_face": "Droid Sans Mono", | |
"font_size": 15, |
#!/usr/bin/ruby | |
## | |
# Classifies a puppet node based on its EC2 security group. | |
# Requires the AWS gem. | |
# Also requires a node_groups.yml file which specifies security groups | |
# and the classes/params that should be applied, in the following | |
# format (additionally keyed by security group name). | |
# http://docs.puppetlabs.com/guides/external_nodes.html | |
# |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html