Skip to content

Instantly share code, notes, and snippets.

@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
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
@mikeal
mikeal / gist:1840641
Created February 16, 2012 01:33
get a new/clean port with node.js
var portrange = 45032
function getPort (cb) {
var port = portrange
portrange += 1
var server = net.createServer()
server.listen(port, function (err) {
server.once('close', function () {
cb(port)
@cgallagher
cgallagher / 34B489.rb
Created July 3, 2012 15:52
Script for pushing out loads of actions in order to see how your Open Graph actions scale out.
require 'rubygems'
require "net/http"
require "net/https"
require "uri"
access_token = "" #App Access Token (app_id|app_secret)
user_id = "" #FBID of an app user who has granted perms to publish actions within your app
og_object_url = "http://dby-staging.herokuapp.com/og/84" #url to the OG data to be pushed along with your user
@paulirish
paulirish / gist:5558557
Last active April 18, 2024 14:32
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

from boto.s3.connection import S3Connection
from progressbar import Percentage, ETA, FileTransferSpeed, Bar, ProgressBar
class S3Transfer(object):
def __init__(self, aws_key, aws_secret):
self.conn = S3Connection(aws_key, aws_secret)
self.progress_bar = None
def _update_progress_bar(self, bytes_transferred, size):
/*!
* jQuery JavaScript Library v2.1.1pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
@una
una / links.md
Last active January 13, 2019 01:27
a-css-carol--links