Skip to content

Instantly share code, notes, and snippets.

View girasquid's full-sized avatar
🦐

Luke Hutscal girasquid

🦐
View GitHub Profile
@klizhentas
klizhentas / twisted_flask
Created June 13, 2013 16:28
Twisted.wsgi + thread pool + flask
from time import time
from logging.config import fileConfig
from twisted.internet import epollreactor
epollreactor.install()
from flask import Flask, request
app = Flask(__name__)
fileConfig("logging.ini")
@techniq
techniq / README.md
Last active December 11, 2015 17:08
Path fixer for Google App Engine to load libraries from packages directory.

path_fixer.py should be placed at the root of your project, and imported at the top of any of your entry point scripts (main.py, manage.py, test.py, etc)

All your libraries should be copied from site-packages (ex. /Library/Python/2.7/site-packages or your virtualenv) and into a packages directory at the root of your project.

myapp
|-- packages
   |-- library1.py
   |-- library2.py
 |-- library3
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'aws/s3'
require 'uri'
AWS::S3::Base.establish_connection!(
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
@girasquid
girasquid / setup.sh
Created September 17, 2012 04:35
How I deploy my side projects
curl -L http://path-to-setup.sh | bash
@girasquid
girasquid / menu.rb
Created August 19, 2012 17:11
Rubygame Menu class
require 'rubygame'
class Menu
def initialize screen, font_file, background, menu=[]
@background = background
@default_color = [0, 0, 0]
@selected_color = [255, 255, 255]
@font_size = 24
@selected_index = 0
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@simonprev
simonprev / gist:3044224
Created July 3, 2012 23:55
Fix my Rdio
1. Open terminal.app
2. Paste this command: defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
(credit: https://twitter.com/defaultswrite/status/220164244954554368)
3. Open Rdio.app
4. Right click and show the inspector panel
5. In the console section, paste this line: $("head").append('<link href="https://s3.amazonaws.com/simon-dev/css/rdio.css" rel="stylesheet" type="text/css">')
@darkhelmet
darkhelmet / quickly.rake
Created June 8, 2012 21:02
Make tests run faster
Rake::TaskManager.class_eval do
def replace_task(old_task, new_task)
@tasks[old_task] = @tasks[new_task]
end
end
desc 'Make tests run faster'
task :quickly do
%w(db:test:load db:test:purge).each do |task|
Rake.application.replace_task(task, 'quickly:nothing')
@jboner
jboner / latency.txt
Last active May 4, 2025 09:35
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#