Skip to content

Instantly share code, notes, and snippets.

View ejamesc's full-sized avatar

Cedric Chin ejamesc

View GitHub Profile
@shawntan
shawntan / bashrc
Created February 13, 2011 04:09
my .bashrc
# /etc/bash/bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
# Test for an interactive shell. There is no need to set anything
@rctay
rctay / __init__.py
Created February 23, 2011 13:37
[python] overloadable decorators
def decorates(dec):
def handler(*args, **kwargs):
if len(args) == 1 and callable(args[0]):
func = args[0]
return dec(func)
else:
def wrapper(func):
return dec(func, *args, **kwargs)
return wrapper
return handler
@abdelazer
abdelazer / epub_to_opds_entry.py
Created April 6, 2011 17:55
A Python program to accept EPUB files as arguments and output an OPDS Catalog Entry skeleton based on the EPUB's metadata
#!/usr/bin/env python
# encoding: utf-8
"""
epub_to_opds_entry.py
Created by Keith Fahlgren on Tue Apr 5 21:21:02 PDT 2011
Copyright (c) 2011 Threepress. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ruiwen
ruiwen / UtilMixIn.py
Created May 9, 2011 19:45
UtilMixIn with JSON renderer for Django models
# Utility classes
class UtilMixIn():
def __json_render_field(self, f, only_fields=[], mapped_fields={}):
field = self._meta.get_field_by_name(f)[0]
if isinstance(field, models.fields.DateTimeField):
return time.mktime(getattr(self, f).timetuple())
elif isinstance(field, models.fields.related.ForeignKey):
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@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
#
@adamgit
adamgit / .gitignore
Last active July 25, 2024 19:57
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@pagreczner
pagreczner / negroniGorillaMux.go
Last active August 9, 2016 08:50
Negroni and Gorilla Mux with Middleware example - golang
package main
import (
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
)
func main() {
router := mux.NewRouter()
apiV1 := router.PathPrefix("/api/v1").Subrouter()
@eduo
eduo / Podcast Process
Created October 22, 2014 14:53
My Podcast Process
1.-Split sides of conversation (only for Call Recorder recordings)
1a.-Use Call Recorder droplets, get two AIFF files, rename to LOCAL and REMOTE
1b.-Use split script https://gist.github.com/eduo/e5bb6f48757cde29ec1b
2.-If audio needs cleanup:
a.-Import into Audacity
a.1.-Split stereo tracks to mono (optional)
b.-Clean bad mic audio (optional)
b.1.-Improve Equalization (if bad sound -> Effects -> Equalize -> EMI 78)
http://wiki.audacityteam.org/wiki/EQCurvesDownload