Skip to content

Instantly share code, notes, and snippets.

@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
@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.
@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
@santosh79
santosh79 / twitter-oauth.js
Created March 3, 2012 07:04
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('util');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = process.env['TWITTER_CONSUMER_KEY'];
var _twitterConsumerSecret = process.env['TWITTER_CONSUMER_SECRET'];
console.log("_twitterConsumerKey: %s and _twitterConsumerSecret %s", process.env['TWITTER_CONSUMER_KEY'], process.env['TWITTER_CONSUMER_SECRET']);
@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() {
#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"}

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

#!/bin/bash
VERSION=$1
PATH=$2
drush dl drupal-$VERSION
rsync -rlt ./drupal-$VERSION/ ./$PATH
rm -r drupal-$VERSION
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
<!--
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