Skip to content

Instantly share code, notes, and snippets.

@MetaThis
MetaThis / server.js
Created August 25, 2011 22:03
Simple example of a Node.js proxy to CouchDB GET requests
var http = require('http'),
request = require('request'), // request module from https://github.com/mikeal/request
url = require('url');
http.createServer(function (req, res) {
var href = url.parse(req.url,true).href;
request('http://127.0.0.1:5984' + href).pipe(res);
}).listen(1337);
// now try something like http://127.0.0.1:1337/your_db_name/_all_docs/?limit=10
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mattn
mattn / dump.vim
Created December 6, 2011 13:18 — forked from ynkdir/dump.vim
google-calendar-holiday
scriptencoding utf-8
let s:calendar_list = [
\ ['Australian Holidays', 'en.australian#[email protected]'],
\ ['Austrian Holidays', 'en.austrian#[email protected]'],
\ ['Brazilian Holidays', 'en.brazilian#[email protected]'],
\ ['Canadian Holidays', 'en.canadian#[email protected]'],
\ ['China Holidays', 'en.china#[email protected]'],
\ ['Christian Holidays', 'en.christian#[email protected]'],
\ ['Danish Holidays', 'en.danish#[email protected]'],
@conspirator
conspirator / Grunt Here
Created January 31, 2012 14:17
The following AppleScript opens up Terminal, navigates to the path of the active Finder window, opens that directory in Sublime Text 2, and finally kicks off Grunt.js.
-- ========================================
-- Author: Christopher Webb
-- Web: http://conspirator.co
-- Twitter: http://twitter.com/conspirator
-- ========================================
set finderPath to ""
tell application "Finder"
try
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@joemccann
joemccann / playlist.md
Created June 25, 2012 20:09
Nodeconf 2012 DJ Playlist

Artist - Track Name

  • Phil Collins - In the Air Tonight
@chrisjaure
chrisjaure / deploy.js
Created July 29, 2012 17:16
Deploying nodejs apps with haibu and git
#! /path/to/node
var haibu = require('/path/to/haibu');
var client = new haibu.drone.Client();
process.stdin.resume();
process.stdin.on('data', function(data){
var package = JSON.parse(data.toString());
@ruzzbot
ruzzbot / stylus-mixin.styl
Created July 31, 2012 03:24
Stylus Mixin Template [CSS,Stylus,Configure,Settings,Template]
//################################################################ STYLUS MIXIN
// Colors
$lavender = #9569bb
$pink = #f468f9
$white = #fff
$black = #000
$grayDark = #333
$grayMed = #666
$grayLight = #999
@ruzzbot
ruzzbot / music-file.coffee
Created August 2, 2012 16:48
A small script to find music files and store them to couchDB
fs = require 'fs'
ID3 = require 'node-id3'
findit = require 'findit'
cradle = require 'cradle'
db = new(cradle.Connection)().database('music')
allowed_files = [ 'mp3', 'aiff', 'wav', 'ogg' ]
mnt = [
'/Users/<username>/Music',
'/Users/<username>/Podcasts' ]
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 20, 2024 11:35
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'