Skip to content

Instantly share code, notes, and snippets.

# The servercom references an entry in my nginx.conf file above
location ~* \.php {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
fastcgi_pass servercom;
fastcgi_param APPLICATION_ENV staging;
}
@shanestillwell
shanestillwell / com.shanestillwell.Selenium.plist
Created September 27, 2012 14:43
Selenium OS X launchctl file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.shanestillwell.Selenium</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
info: Welcome to Nodejitsu hidef
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in web.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/shane/Sites/divinely.web/package.json
data:
data: {
info: Welcome to Nodejitsu hidef
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in web.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/shane/Sites/divinely.web/package.json
data:
data: {
@shanestillwell
shanestillwell / index.js
Created August 20, 2012 21:57 — forked from jankuca/index.js
Simple Facebook Graph API Node.js Client
var HTTPS = require('https');
var QueryString = require('querystring');
/**
* Facebook API Wrapper
* @constructor
* @param {Object} info Info about a Facebook application
*/
var Client = function (info) {
if (!info.KEY || !info.SECRET || !info.ID) {
@shanestillwell
shanestillwell / hello.md
Created August 15, 2012 16:50
Coding for gold

Coding for gold

Just testing out this here thing.

I really need to learn Markdown... it's the new bomb

@shanestillwell
shanestillwell / user-data.sh
Created July 17, 2012 22:18
Amazon User Data script
#!/bin/bash
### BEGIN INIT INFO
# Provides: ec2-run-user-data
# Required-Start: $network $local_fs $remote_fs $syslog $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run EC2 user-data scripts
# Description: On first boot of EC2 instance, runs user-data if it starts with #!
@shanestillwell
shanestillwell / OSX Lion pecl and pear.mdown
Created July 16, 2012 21:45 — forked from wearethefoos/OSX Lion pecl and pear.mdown
Native OSX Lion pecl and pear config
$ sudo /usr/bin/php /usr/lib/php/install-pear-nozlib.phar

$ cat >> ~/.bashrc <<'EOF' 

alias pear="php /usr/lib/php/pear/pearcmd.php" 
alias pecl="php /usr/lib/php/pear/peclcmd.php" 
EOF

$ . ~/.bashrc
@shanestillwell
shanestillwell / doctrine_or_query.php
Created March 9, 2012 01:04
Query Doctrine ODM with an OR
<?php
$result = $this->_dm->createQueryBuilder('HOD\Model\Person');
$result->addOr($result->expr()->field('firstName')->equals(new \MongoRegex("/^{$query}/i")))
->addOr($result->expr()->field('lastName')->equals(new \MongoRegex("/^{$query}/i")));
return $result->getQuery()->execute();
if($location!=null){
if( !empty($location) && isset($location['latitude']) && isset($location['longitude'])){
array_push($selectFields, "
SQRT(
POW(
(
'69.1'
* (longitude - '". $location['longitude']."')
* COS('".$location['latitude']."'/'57.3')
)