This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
sudo apt-get update | |
sudo apt-get upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
# ZSH_THEME="robbyrussell" | |
ZSH_THEME="gentoo" | |
# Example aliases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%% Find unused exports in a given module | |
%% Example: deadcode mod_foo deps/foo/ebin deps/bar/ebin | |
%% Assumes this script is in a file named deadcode | |
main([Module0|Dirs]) -> | |
Module = list_to_atom(Module0), | |
{ok, _Pid} = xref:start(foo), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Modifies the App Engine datastore to support local caching of entities. | |
This is achieved by monkeypatching google.appengine.ext.db to recognise model | |
classes that should be cached and store them locally for the duration of a | |
single page request. | |
Note that only datastore gets (and anything that relies on them, such as | |
ReferenceProperty fetches) are cached; queries will neither return cached | |
entities nor update the cache. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(badger). | |
-export([encoding/1]). | |
-spec encoding(binary()) -> gzip | compress | deflate | identity. | |
encoding(AcceptEncoding) -> | |
EncodingList = encoding_list(AcceptEncoding), | |
{Enc, _} = | |
lists:foldl(fun({E, Q}, {MaxEnc, MaxQval}) -> | |
E1 = encoding_map(E), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add ssh key from your machine to bitbucket keys here https://bitbucket.org/account/ | |
puzza@imac:~/src/test$ cat ~/.ssh/id_rsa.pub | |
ssh-rsa XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX== [email protected] | |
# push an already existing rep | |
puzza@imac:~/src/test$ git init | |
Initialized empty Git repository in /Users/puzza/src/test/.git/ | |
puzza@imac:~/src/test$ touch foo | |
puzza@imac:~/src/test$ git add . | |
puzza@imac:~/src/test$ git commit -m 'import an empty file' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Params = #amqp_params{ | |
username = iolist_to_binary(User), | |
password = iolist_to_binary(Password), | |
virtual_host = iolist_to_binary(Vhost), | |
host = Host, | |
port = Port | |
}, | |
Params = #amqp_params{ | |
username = iolist_to_binary(User), | |
password = iolist_to_binary(Password), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(case-fold-search t) | |
'(column-number-mode t) | |
'(current-language-environment "Latin-1") | |
'(default-input-method "latin-1-prefix") | |
'(global-font-lock-mode t nil (font-lock)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(foo). | |
-export([list_comprehension/0, statements/0]). | |
get_foo(S) -> | |
S. | |
list_comprehension() -> | |
[get_foo(S) || S <- ["a","b","c"]]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% If this occurs in something that's called often (and might qualify as an inner loop, | |
%% or might not) does either method have a speed advantage? | |
[A,B,C] = [get_foo(S) || S<-["a","b","c"], | |
% versus | |
A = get_foo("a"), | |
B = get_foo("b"), | |
C = get_foo("c"), |