This file contains 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
# Comment in the above and uncomment this below for a color prompt | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\] ~~ \[\033[01;32m\]\w\[\033[00m\]\n\$> ' | |
if [ -f ~/.bash_completion ]; then | |
. ~/.bash_completion | |
fi | |
if [ -f ~/.bash_alias ]; then | |
. ~/.bash_alias | |
fi |
This file contains 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
sync_git_branches () { | |
for BRANCH in $(git remote); do | |
git pull $BRANCH master; | |
done | |
} | |
sync_git_repos () { | |
CURR=$(pwd); | |
for DIR in $(ls); do | |
cd $DIR; sync_git_branches; |
This file contains 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
use DB::CouchDB::Schema; | |
use DBI; | |
my $mysql = DBI->connect("DBI:mysql:database=<databaseName>;host=localhost", '<username>', '<password>'); | |
my $schema = DB::CouchDB::Schema->new(host => 'localhost', db => 'metabase'); | |
my $sth = $mysql->prepare("select post_name, | |
post_title, | |
post_date, | |
post_category, |
This file contains 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
sub return_errors() { | |
my $do_error = shift; | |
if ($do_error) { | |
return {error => 1}; | |
} | |
return {error => 0}; | |
} | |
my $is_error = return_errors(1); |
This file contains 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(db_migrate_tools). | |
-compile(export_all). | |
-include("iterate_records.hrl"). | |
-include_lib("stdlib/include/qlc.hrl"). | |
get_transformed(T, F) -> | |
Trans = fun() -> | |
QH = qlc:q([F(R) || R <- mnesia:table(T)]) | |
, qlc:eval(QH) |
This file contains 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(date_util). | |
-compile(export_all). | |
epoch() -> | |
now_to_seconds(now()) | |
. | |
epoch_hires() -> | |
now_to_seconds_hires(now()) | |
. |
This file contains 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(element_flot_chart). | |
-compile(export_all). | |
-include_lib("nitrogen/include/wf.inc"). | |
-include("elements.hrl"). | |
reflect() -> record_info(fields, flot_chart). | |
rec() -> #flot_chart{}. |
This file contains 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(string_utils). | |
-compile(export_all). | |
flatten_string_list(List) when is_list(List) -> | |
flatten_string_list(List, []). | |
flatten_string_list([H|T], Tail) when is_list(H) -> | |
case io_lib:char_list(H) of | |
false -> | |
flatten_string_list(H, flatten_string_list(T, Tail)); |
This file contains 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
/** | |
* SyntaxHighlighter | |
* http://alexgorbatchev.com/ | |
* | |
* Custom erlang SyntaxHighlighterBrush | |
*/ | |
SyntaxHighlighter.brushes.Erlang = function() | |
{ | |
// Contributed by David Simmons-Duffin and Marty Kube |
This file contains 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 (web_postback_test). | |
-include_lib ("nitrogen/include/wf.inc"). | |
-compile(export_all). | |
main() -> | |
%TODO(jwall): force identity | |
#template { file="./wwwroot/api_test.html"} | |
. | |
test() -> |
OlderNewer