Skip to content

Instantly share code, notes, and snippets.

View ricardobeat's full-sized avatar

Ricardo Tomasi ricardobeat

View GitHub Profile
@ricardobeat
ricardobeat / .profile
Created March 21, 2014 10:30
Work .profile
source ~/ps1.sh
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias ls='ls -GFh'
alias lsd='ls -d -- */'
#/usr/local/bin before /usr/bin
#export PATH='/usr/local/bin:$PATH'
@ricardobeat
ricardobeat / .slate
Created March 28, 2014 10:51
slate config
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Save and restore snapshot
bind 0:ctrl snapshot work3 save-to-disk
bind 0:ctrl;alt activate-snapshot work3
# Push Bindings
@ricardobeat
ricardobeat / .gitconfig
Created December 3, 2014 10:28
git aliases
[alias]
lg = log -20 --graph --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn\\ %C(cyan)%cr]" --decorate --abbrev-commit --date=relative
who = shortlog -sn
dip = diff --patience
stat = status -sb
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
word = diff --word-diff=color
up = "!git fetch --all -p && git rebase @{u}"
mine = "!git lg --author=\"$(git config user.name)\""
aliases = "!git config --list | grep alias | cut -c 7- | sed 's/=//' | column -t -s ''"
@ricardobeat
ricardobeat / .prompt
Created December 3, 2014 10:46
simpler prompt
function _e () {
local color; local escape; local newline; local bold=0
if [[ $1 == "bold" ]]; then
shift; bold=1
fi
case $1 in
white ) color=37 ;;
red ) color=31 ;;
green ) color=32 ;;
yellow ) color=33 ;;
@ricardobeat
ricardobeat / chess.js
Last active August 29, 2015 14:13
compiling chess results with node streams
#!/usr/bin/env node
var fs = require('fs')
var path = require('path')
var dir = process.argv[2]
if (!dir) throw new Error('Usage: ./chess.js path-to-pgn-files/ ')
var white = 0
var black = 0
@ricardobeat
ricardobeat / stupid-ie7-console-log.js
Last active August 29, 2015 14:13
IE7 panel for console.*
;(function () {
var doc = document.documentElement
var IE7 = navigator.userAgent.indexOf('MSIE 7') > 0
logpane = document.createElement('div')
var height = 180
var width = 480
document.body.appendChild(logpane)
logpane.style.background = '#fff'
logpane.style.padding = '10px'
logpane.style.position = IE7 ? 'absolute' : 'fixed'
Verifying I am +ricardobeat on my passcard. https://onename.com/ricardobeat
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<!--Site-->
<div id="site">
<!--container-->
<div id="container">
function testAttributeSupport() {
var head = document.getElementsByTagName('head')[0];
var style = document.createElement('style');
var s = 'div[id] {}';
style.type = 'text/css';
if (style.styleSheet)
style.styleSheet.cssText = s;
else
style.appendChild( document.createTextNode(s) );
w = new Stream('net://'+jsArguments[0]);
r = true;
while(r){
sleep(500);
txt = system.stdin.readLine();
if (txt) {
w.writeln( txt );
}
if (txt == 'quit'){
r = false;