Skip to content

Instantly share code, notes, and snippets.

Avatar

Larz Conwell larzconwell

View GitHub Profile
@larzconwell
larzconwell / gist:5710523
Created Jun 4, 2013
Correlation between people who use tabs vs spaces and people use double vs single spacing after sentence (WIP)
View gist:5710523
var request = require('request'),
async = require('async');
// Gets the first >=1000 unique(not forked) repos from Github
function getRepos (callback) {
var repos = [],
lastId = 0,
reqOpts = {
uri: 'https://api.github.com/repositories',
qs: {since: 0},
@larzconwell
larzconwell / layout_state.js
Last active Dec 16, 2015
This is the state for one of the incorrectly rendered pages from lib/template/template_node.js in the handleLoaded function. Layouts and templates are split up and joined later via the yield function in layouts.
View layout_state.js
// Here if you look at the content field the template replaced
// from yield(in the adapter.template field), it's different
// than the content field from the template_state.js content field.
{ id: 0,
data:
{ registered: true,
file: 'app/views/layouts/application.html.ejs',
ext: '.ejs',
baseName: 'application',
baseNamePath: 'app/views/layouts/application' },
View file.rb
// In a package file, version only
// needs to be included in one
// source file
package test, "1.2.3-pre"
// In another program
import (
fmt fmt
test github.com/hey/test, "1.2.3-pre"
)
View gist:4724992
% ~ ✓ 0 › rvm install 1.9.3
Unrecognized command line argument: '1.9.3' ( see: 'rvm usage' )
% ~ × 1 ›
View gist:4708667
# Open node documentation in your browser.
# Usage: node-docs [module=all] [version=$(node --version)]
function node-docs() {
local version="$(node --version)"
local module="all"
local url="http://nodejs.org/docs/"
if [[ "$2" != "" ]]; then
version="v$2"
fi
@larzconwell
larzconwell / gist:4679121
Created Jan 31, 2013
ZSH: Call `ls -a` whenever we change directories(includes changing dirs when autocd is set)
View gist:4679121
function chpwd() {
emulate -L zsh
ls -a
}
View gist:4535894
# Display prompt
#PS1='%~:%# '
setopt prompt_subst
autoload colors
autoload -Uz vcs_info
colors
# Set colors for easier reading
for COLOR in RED GREEN YELLOW BLUE WHITE BLACK CYAN; do
eval PR_$COLOR='%{$fg[${(L)COLOR}]%}'
@larzconwell
larzconwell / gist:4470370
Last active Dec 10, 2015
Handle asset compiling in Geddy, temp solution
View gist:4470370
/*
* Simple asset compiler for Geddy, should be okay to use in production as it
* creates on init, and only updates when files change.
* (though it would waste resources as it still watches the dirs)
*
* To use do the following in your shell:
* mkdir -p app/assets/{css,js}
* touch config/after_start.js
*
* after that just copy these contents into config/after_start.js
View gist:4424664
shopt -e nocaseglob
set -e
clear
#
# Variables
#
GoVersion="1.0.3"
RedisVersion="2.6.7"
View gist:4281885
# These $(pkg-config) commands don't expand when building objects and binaries
CFLAGS=-std=c99 -Wall -g $(pkg-config --cflags apr-1 apr-util-1)
LDFLAGS=$(pkg-config --libs apr-1 apr-util-1)
whatever: bstrlib.o