Skip to content

Instantly share code, notes, and snippets.

View imom0's full-sized avatar
💭
I may be slow to respond.

iMom0 imom0

💭
I may be slow to respond.
View GitHub Profile
@tmm1
tmm1 / fbr.rb
Created August 8, 2008 22:16
Poor Man's Fiber (API compatible Thread based Fiber implementation for Ruby 1.8) [http://github.com/tmm1/fiber18/tree/master]
# Poor Man's Fiber (API compatible Thread based Fiber implementation for Ruby 1.8)
# (c) 2008 Aman Gupta (tmm1)
unless defined? Fiber
require 'thread'
class FiberError < StandardError; end
class Fiber
def initialize
@textarcana
textarcana / .emacs
Created February 14, 2009 22:06
.emacs file for Aquamacs Emacs and GNU Emacs on OS X.
;;Noah Sussman's .emacs file for Aquamacs Emacs and GNU Emacs on OS X.
;;Branched February 16 2008 from my config for GNU Emacs for Windows, created Oct 18 2001.
;;Time-stamp: </Users/noah/Documents/n_s/config/emacs/aquamacs/.emacs last changed by Noah Sussman on noah.local/Textarcana Saturday 14 February 2009 at EST 16:51:25>
(load-file "~/.emacs-cfg/secrets.el")
;;;; Spaces are always used for indendation
;;;;;; Haml and Sass modes require this setting
(setq indent-tabs-mode nil)
@tudisco
tudisco / JavascriptUTF8EncodeDecodeWebkit.js
Created February 20, 2010 03:31
javascript utf8 encode and decode
/**
*
* UTF-8 data encode / decode
* http://www.webtoolkit.info/
*
**/
var Utf8 = {
// public method for url encoding
@dcramer
dcramer / track_data.py
Created December 6, 2010 19:15
Tracking changes on properties in Django
from django.db.models.signals import post_init
def track_data(*fields):
"""
Tracks property changes on a model instance.
The changed list of properties is refreshed on model initialization
and save.
>>> @track_data('name')
@fwonce
fwonce / pentadactylrc
Created February 13, 2011 14:52
my RC file for Firefox addon, Pentadactyl
" fwonce's .vimperatorrc
" now it's .pentadactylrc
" Last modified: Jan 12, 2011
"set exrc
""""""""""""""
" Appearance "
""""""""""""""
" Status Bar, tab num
@eklitzke
eklitzke / percona.live.notes.md
Created February 17, 2011 01:04
percona live notes

Percona Server with XtraDB

Introduction

  • 2010 InnoDB 5.1 announced, will first ship with MySQL 5.5.
  • Historically InnoDB development lags while MySQL is trying to GA
  • lots of things fixed in InnoDB since MySQL 5.0
  • important note -- plugin version of InnoDB is not the default in 5.1
@imom0
imom0 / xjtulib.sh
Created March 10, 2011 11:32
A shell script to get the 150 IPs of xjtu lib.
#!/bin/sh
lock=/tmp/mac_lock
wlan=wlan0
essid=xjtu_lib
mac_base="C9:1A:B9:6B:6C:"
function req_addr() {
if [ -f "$lock" ]
then
@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
@pithyless
pithyless / gist:1208841
Created September 10, 2011 21:49
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@sssionggg
sssionggg / ge.py
Created October 4, 2011 20:17
gevent vs thread
#!/usr/bin/python
# Copyright (c) 2009 Denis Bilenko. See LICENSE for details.
"""Spawn multiple workers and wait for them to complete"""
hosts = ["http://yahoo.com", "http://google.com", "http://amazon.com", "http://ibm.com", "http://apple.com"]
import gevent
from gevent import monkey