Skip to content

Instantly share code, notes, and snippets.

View radicalsauce's full-sized avatar

radicalsauce

  • San Francisco, CA
View GitHub Profile
@obfusk
obfusk / break.py
Last active March 20, 2024 23:09
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()))
@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
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);
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@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