Skip to content

Instantly share code, notes, and snippets.

View gabro's full-sized avatar

Gabriele Petronella gabro

View GitHub Profile
@gabro
gabro / git-working-history
Last active March 27, 2023 09:47
Github-like working directory history
#!/bin/bash
FILES=`git ls-tree --name-only HEAD .`
MAXLEN=0
IFS=$(echo -en "\n\b")
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done
@gabro
gabro / user.js
Created February 27, 2013 22:45
node-example
var userSchema = new Schema(
fb_id : String,
firstName : String,
lastName : String,
messages : [{
content : String,
positive : Boolean,
author : User,
created_at : {type : Date, default : Date.now},
updated_at : {type : Date, default : Date.now}
@gabro
gabro / Money Chicago
Last active December 11, 2015 03:08
Money Chicago
var money =
"@people: luca gio dani gabro claudio jaja mike paolo\n"+
"@group: luca gio dani gabro claudio jaja\n"+
"@date: debiti e payback\n"+
"~Debiti (Dani 52.13 Luca 356.37 Gabro 13.18) claudio 309.88 gio 28.98 jaja 17.25 mike 64.51\n"+
"15 gio -> dani\n"+
"400 claudio -> gabro\n"+
"10 dani -> jaja\n"+
@gabro
gabro / gist:4322163
Created December 17, 2012 20:57
A parametric algebraic data type in Haskell
data UnionFindElement valueType =
RootElement valueType |
ElementWithParent valueType (UnionFindElement valueType)
deriving (Eq, Show)
@gabro
gabro / main.tex
Created December 7, 2012 19:23
An example of a multi-part LaTeX document
\documentclass{article}
\title{A long document}
\author{Gabriele Petronella}
\date{\today}
\begin{document}
\maketitle
@gabro
gabro / sublime.tex
Created December 2, 2012 00:25
LaTeX example
\documentclass{article}
\title{LaTeX is now Sublime}
\author{Gabriele Petronella}
\begin{document}
\maketitle
\section{My first section}