Skip to content

Instantly share code, notes, and snippets.

View ascii766164696D's full-sized avatar
πŸ‘‰
πŸ‘ˆπŸ˜Ž

ascii766164696D

πŸ‘‰
πŸ‘ˆπŸ˜Ž
View GitHub Profile
@ascii766164696D
ascii766164696D / gist:4382108
Created December 26, 2012 18:36
Bash command status
PS1="\$(if [ \${?##0} ]; then echo '\e[1;31;40m\]✘\e[0m\]'; else echo '\e[1;32;40m\]βœ”\e[0m\]'; fi) …"
@ascii766164696D
ascii766164696D / gist:3841291
Created October 5, 2012 17:50
php madskillz
$a = array(…);
$b = 1;
foreach ($a as $v) {
if ($b) {
$a = array();
$b = 0;
}
$a[] = f($v);
}
unset($b);
@ascii766164696D
ascii766164696D / gist:3825405
Created October 3, 2012 06:29
eclipse.ini for Scala plugin
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504
--launcher.XXMaxPermSize
384m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-server
-XX:PermSize=256m
@ascii766164696D
ascii766164696D / ring_bench.erl
Created January 6, 2012 12:47
erlang message pass through processes ring
-module(ring_bench).
-export([start/1]).
%% start([N, M])
%% Create N processes into ring and sned message round the ring M times
start([A, B]) ->
N = list_to_integer(atom_to_list(A)),
M = list_to_integer(atom_to_list(B)),
Self = self(),
@ascii766164696D
ascii766164696D / vtb_csv2qif.js
Created December 26, 2011 09:25
VTB24 csv to QIF converter
/*
* @description VTB24 csv to QIF converter
* @usage cat vtb.csv | node vtb_csv2qif.js > vtb.qif
* @url http://en.wikipedia.org/wiki/Quicken_Interchange_Format
*/
var fs = require('fs');
var vtb_csv = fs.readFileSync('/dev/stdin').toString(),
exchange_rate = 31.2575;
var vtb_qif = vtb_csv.replace(