Skip to content

Instantly share code, notes, and snippets.

View zeekay's full-sized avatar
💎
👋

z zeekay

💎
👋
View GitHub Profile
zk@qi ~/.vim ‹2d master 5a4a480753›
› cloc .
5927 text files.
5550 unique files.
13970 files ignored.
http://cloc.sourceforge.net v 1.56 T=20.0 s (43.2 files/s, 8243.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
async = require 'async'
async.waterfall [
(cb) ->
cb null, 1
(one, cb) ->
cb null, one, 2
(one, two, cb) ->
var fs = require('fs'),
uglify = require('uglify-js2'),
code = fs.readFileSync('./orig.js', 'utf8');
var ast = uglify.parse(code);
// List all functions
var functions = [];
var walker = new uglify.TreeWalker(function(node){
if (node instanceof uglify.AST_Defun) {
function foo(x) {
return x;
}
function bar() {
return foo.call(this, 42);
}
var calls = [];
@zeekay
zeekay / gist:3877034
Created October 12, 2012 02:49
Tastypie helper
from inspect import isclass
from tastypie.resources import ModelResource
from django.conf import settings
from itertools import chain
def generate_urls():
for app in settings.INSTALLED_APPS:
if not app.startswith('django'):
try:
require 'formula'
class TidyHtml5 < Formula
head 'git://github.com/w3c/tidy-html5.git'
homepage 'http://w3c.github.com/tidy-html5/'
def install
system "make",
"-Cbuild/gmake",
"-j1", # make fails with this Makefile when jobs > 1
module.exports =
staticPath: './public'
bundles:
'/app.css':
main: './assets/css/app.styl'
'/app.js':
main: './assets/js/app.coffee'
servers = (
{
address = "innerirc.net";
chatnet = "innerirc";
port = "6697";
use_ssl = "yes";
ssl_verify = "no";
autoconnect = "no";
},
{
#user http;
worker_processes 4;
#worker_cpu_affinity 0100 1000;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
let g:disable_arrow_keys = 1
so ~/.vim/vimrc
nnoremap ; :
vnoremap ; :
nnoremap J <c-d>
nnoremap K <c-u>
vnoremap J <c-d>