Skip to content

Instantly share code, notes, and snippets.

View radicalsauce's full-sized avatar

radicalsauce

  • San Francisco, CA
View GitHub Profile
@kentbrew
kentbrew / favicon-interceptor.js
Created January 3, 2011 19:32
How to short-circuit those annoying favicon requests in node.js
// early experiments with node had mysterious double requests
// turned out these were for the stoopid favicon
// here's how to short-circuit those requests
// and stop seeing 404 errors in your client console
var http = require('http');
http.createServer(function (q, r) {
// control for favicon
var quicksort = function(A) {
var swap = function(a, b) {
var temp = A[a];
A[a] = A[b];
A[b] = temp;
}
var partition = function(left, right) {
var pivotIndex = Math.floor((left + right) / 2);
@tgrrtt
tgrrtt / newubuntu.sh
Last active August 29, 2015 14:09
New Ubuntu Setup w/ Nginx & Upstart
curl -sL https://deb.nodesource.com/setup | sudo bash - &&
sudo apt-get install -y nodejs
sudo apt-get update &&
sudo apt-get install nginx &&
sudo apt-get install git
## upgrade aps and resolve deps with the more important ones
sudo apt-get dist-upgrade
#chagne to root
@obfusk
obfusk / break.py
Last active September 2, 2024 16:23
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))