Skip to content

Instantly share code, notes, and snippets.

@milmazz
milmazz / .gitconfig
Created April 6, 2010 03:04
Configuration files for Git
[user]
name = Milton Mazzarri
email = milmazz@gmail.com
[diff]
external = gitdiff
[pager]
diff =
[color]
status = auto
branch = auto
@milmazz
milmazz / post-commit.pl
Created April 23, 2010 19:43
Subversion's post-commit hook (svn-notify)
#!/usr/bin/perl -w
use strict;
use SVN::Notify;
my $path = $ARGV[0];
my $rev = $ARGV[1];
my %params = (
repos_path => $path,
@milmazz
milmazz / trac_query.pl
Created November 17, 2010 21:02
Trac tickets queries
#!/usr/bin/perl
use warnings;
use strict;
use Net::Trac;
use Class::CSV;
# Estableciendo la conexion a la instancia remota de Trac
my $trac = Net::Trac::Connection->new(
@milmazz
milmazz / kindle-es.rst
Created December 8, 2010 13:48
Kindle Cheat Sheet

Kindle Cheat Sheet

Global
Alt-Shift-G | Captura de pantalla

+-------------------------------+

@milmazz
milmazz / laziness.py
Last active December 11, 2015 15:38
Merge info from two excel files, after that, create another excel file with the results.
#!/usr/bin/python
# -*- coding: utf-8 -*-
__version__ = '0.1'
import xlrd
import re
import xlwt
import argparse
@milmazz
milmazz / final.js
Last active August 29, 2015 14:02
DRY principle
// Before:
// CallBacks.loadJsonView(url, "POST", Historicals.UpdateCombo, params);
// After:
$.post(url, params, Historicals.UpdateCombo, "json");
// Before:
// CallBacks.loadPartialView(url, "POST", infoDialog, params);
// After:
$.post(url, params, infoDialog, "html");
@milmazz
milmazz / Gruntfile.js
Last active August 29, 2015 14:03
Grunt: The Javascript Task Manager
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsdoc : {
dist : {
src: ['src/*.js', 'test/*.js'],
dest: 'doc'
}
@milmazz
milmazz / Portfile
Last active January 24, 2016 20:14
Portfile for Elixir programming language
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
PortGroup github 1.0
github.setup elixir-lang elixir 1.2.1 v
epoch 1
categories lang
platforms darwin
@milmazz
milmazz / README.md
Last active April 18, 2017 23:55
Elixir
@milmazz
milmazz / ipv4parser.ex
Last active January 15, 2021 23:43
The Little Elixir & OTP Guidebook
defmodule IPv4Parser do
@moduledoc """
Exercise 2.8.6 from the book The Little Elixir & OTP Guidebook
The idea is to take a look at the IPv4 packet spec and try to write a
parser.
"""
def parse(packet) do
<<