Skip to content

Instantly share code, notes, and snippets.

<?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
<!--
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
#!/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() {
@jhs
jhs / example.js
Created December 10, 2012 03:16
My Node.js modules these days
// Short module explanation // Something to gather my thoughts
// // I think this looks cool.
//
module.exports = the_exported_function // Modules are a function. Always.
//
module.exports.extra = extra // Additional API entry points if
module.exports.other = other // desired.
//
var util = require('util') // Other packages from npm or core
var assert = require('assert') // No comma-first due to lots of
@tylor
tylor / tweet-counts.js
Created December 16, 2012 23:07
Scan your Twitter archive to get a basic count of the people you've talked to and the words that you've used.
/*
* Scan your official Twitter archive to get a basic count of the
* people you've talked to and the words that you've used.
*
* $ node tweet-counts.js ~/path/to/tweets-archive/
*
*/
var fs = require('fs');
var base = process.argv[2].replace(/\/$/, ''); // Strip trailing slash.
var Grailbird = { data: {} }; // The Twitter archive uses this.
@chenosaurus
chenosaurus / buy.js
Last active April 21, 2017 09:47
script to buy bitcoin on coinbase
//you will need to install node.js and restler first
//npm install restler
//run with the following command
// node buy.js
var sys = require('util'),
rest = require('restler');
//set these to your coinbase API key & the amount you want to buy