Skip to content

Instantly share code, notes, and snippets.

@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
<?php
/**
* This file goes in ~/.drush/
* Rename to GROUPNAME.aliases.drushrc.php
*
* Examples (run from any path on your local environment):
*
* drush @example.dev status
* drush sql-sync @example.stage @example.dev
*
#!/bin/bash
# Sync a Drupal database and contents of files directory between two
# development environments.
#
# Execute this script on the destination (DEST) server.
# A MEMBERNAME.aliases.drushrc.php file is required on the SOURCE server.
# See http://gist.github.com/421721 and remove example.local alias
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
<!--
Fork this HTML code and fix it!
Code block from: https://psjobs-emploisfp.psc-cfp.gc.ca/psrs-srfp/applicant/1/page1190
This block of code is referenced in Point #44 of the "Factum of the Applicant"
report in the case between Donna Jodhan and Attorney General of Canada[1].
[1] http://www.bakerlaw.ca/content/blind-mba-have-her-day-court-over-inaccessible-government-websites
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl http://npmjs.org/install.sh | sh
#!/bin/bash
VERSION=$1
PATH=$2
drush dl drupal-$VERSION
rsync -rlt ./drupal-$VERSION/ ./$PATH
rm -r drupal-$VERSION

Installing Sphinx on OSX 10.6 with MAMP 1.9.4

The MAMP 1.9.4 MySQL installation is missing the include directory and certain libraries.

Download the MAMP 1.9 Components

Extract mysql-5.1.44.tar.gz and compile to /opt/local

cd mysql-5.1.44

./configure --prefix=/opt/local

#Steps
pkgin install couchdb
svccfg import /opt/local/share/smf/manifest/couchdb.xml
svcadm enable couchdb
#Test
curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"1.0.1"}
@smithmilner
smithmilner / boxes_twitter.inc
Created June 7, 2011 17:44
A custom box plugin for twitter pull.
<?php
/**
* Custom Twitter Box
*/
class boxes_twitter extends boxes_box {
/**
* Implementation of boxes_box::options_defaults().
*/
public function options_defaults() {