Skip to content

Instantly share code, notes, and snippets.

View joemccann's full-sized avatar
💭
Thinking

Joe McCann joemccann

💭
Thinking
View GitHub Profile
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
</head>
<body>
<div id="output"></div>
<script>
function write (msg) {
var p = document.createElement('p');
p.innerHTML = 'LOG: ' + msg;
@brianleroux
brianleroux / npm-picnic.md
Created September 6, 2011 19:11
nodeconf camp discussion about npm things

npm hangout

wherein we hang out and talk about npm stuff and occasionally mock ruby

using npm for building node extensions

  • npm catches missing node-waf and/or node-waf deps like python - charlie
How to add cmd-left-arrow and cmd-right-arrow (without shift) key bindings to the mac os x Terminal
app if the Lion install removed this bindings from your system.
1) Open "System Preferences".
2) Go to "Keyboard".
3) Select the "Keyboard Shortcuts" tab.
4) Select "Application Shortcuts" from the list of items in the left.
5) Press "+" to add a new shurtcut.
6) As "Application" select "Terminal", as "Menu Title" use: "Select Next Tab". For the "Keyboard Shortcut" field just select the field and press cmd-right-arrow.
7) Repeat again from step 5, using "Select Previous Tab" as Menu Title and pressing cmd-left-arrow as keyboard shortcut.
@davidwood
davidwood / FUCK-YA.md
Created December 9, 2011 19:59
List content type of files in Cloudfiles container

How to list the content type of all files in a Cloudfiles container.

  1. Install node and npm
  2. Install the awesome Cloudfiles package from Nodejitsu
  3. Create a folder and save the dw-is-my-hero.js to that folder
  4. Edit dw-is-my-hero.js and change USERNAME and API_KEY to your username and API key
  5. Run node dw-is-my-hero.js CONTAINER_NAME
  6. Smile (and tell people how rad node.js is)
@pec1985
pec1985 / app.js
Created December 30, 2011 17:21
LinkedIn effect - Titanium
// right navigation button
var btn = Ti.UI.createButton({
title:'button'
});
// window
var win = Ti.UI.createWindow({
rightNavButton:btn,
backgroundColor:'blue'
});
@chmouel
chmouel / upload-to-rackspace-cloud-file.sh
Created June 9, 2010 18:53
Upload to RackSpace CloudFiles from shell with curl.
#!/bin/bash
# Author: Chmouel Boudjnah <chmouel.boudjnah@rackspace.co.uk>
# Not officially supported by Rackspace only as a best effort basis :)
# Define yes to make it to copy to url to clipboard (via a shortened url
# service) You need to have the software xclip installed in your system.
COPY_URL_TO_CLIPBOARD=yes
# Containers to ignore in the list
CONTAINERS_TO_IGNORE=".CDN_ACCESS_LOGS"
@calderas
calderas / npm.js
Created October 6, 2011 18:57
npm setup
npm config set registry http://registry.npmjs.org/
npm config set proxy http://http-proxy.com:80
npm install -d
module.exports = tree
tree.sync = treeSync
var fs = require("fs")
, path = require("path")
function tree (root, cb) {
fs.lstat(root, function (er, s) {
if (er) return cb(er)
s.name = root
@prdn
prdn / bfx_pub_shard.js
Last active August 30, 2018 08:11
Bitfinex Public Market Data sharding on multiple sockets
/*
npm install ws request crc-32
*/
const WebSocket = require('ws')
const request = require('request')
const CRC = require('crc-32')
const LIMIT_CHAN = 250
@oyvindholmstad
oyvindholmstad / schema-generator.js
Last active September 21, 2018 06:54
BigQuery JSON schema generator in Javascript and Scala
/*
A script to generate a Google BigQuery-complient JSON-schema from a JSON object.
Make sure the JSON object is complete before generating, null values will be skipped.
References:
https://cloud.google.com/bigquery/docs/data
https://cloud.google.com/bigquery/docs/personsDataSchema.json
https://gist.github.com/igrigorik/83334277835625916cd6
... and a couple of visits to StackOverflow