Skip to content

Instantly share code, notes, and snippets.

View joaopizani's full-sized avatar

João Pizani joaopizani

View GitHub Profile

Keybase proof

I hereby claim:

  • I am joaopizani on github.
  • I am joaopizani (https://keybase.io/joaopizani) on keybase.
  • I have a public key whose fingerprint is A24C A3FF 5F98 97AB F02D 59DA 392A 829D B04D BC17

To claim this, I am signing this object:

@joaopizani
joaopizani / pydelatt.py
Last active December 23, 2015 03:19 — forked from simeonf/pydelatt.py
#!/usr/bin/python
"""
Copyright (c) 2009 Simeon Franklin
MIT Licensed: see http://www.opensource.org/licenses/mit-license.php
pydelatt.py - Strips attachments from maildir format mail
files. Sample usage:
$ find ./Maildir -mtime +120 -size +3M | xargs -ix pydelatt.py -v 'x'
@joaopizani
joaopizani / gnu-screen-shared.md
Created March 20, 2013 00:20
The README of my gnu-screen-shared repo, as of March 2013, for publication purposes.

gnu-screen-shared

GNU Screen has A LOT of interesting applications, and I like it a lot - so much that I have spent some time tinkering it.

One of the MOST interesting features that GNU Screen provides is screen session sharing. That means that you can start a screen session on your computer and OTHER USERS can connect to that screen session in order to just watch or also interact with the session. You can have a remote colleague log in to your machine via SSH using a "guest" account, for example, and

@joaopizani
joaopizani / .rtorrentrc
Created August 27, 2012 22:29
A reasonable rtorrent setup that Just Works®
# Default session directory. Make sure you don't run multiple instances with the same dir.
session = ~/torrent/session
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 50
max_peers = 400
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 20
@joaopizani
joaopizani / gist:2816940
Created May 28, 2012 02:48
Parallel make in Vim with automatic detection of available processor cores
" set makeprg so that when you activate :make, then make -j<N+1> is
" run, where N is the exact number of processor cores in your machine.
function! SetMakeprg()
if !empty($NUMBER_OF_PROCESSORS)
let n = $NUMBER_OF_PROCESSORS + 0
elseif filereadable('/proc/cpuinfo')
let n = system('grep -c ^processor /proc/cpuinfo') + 0
else
let n = 1
endif
@joaopizani
joaopizani / RobertsEdgeDetect.hs
Created May 17, 2012 12:20
The complete Roberts edge detection algorithm implemented in Haskell
{-# LANGUAGE PackageImports, BangPatterns, QuasiQuotes #-}
module Main where
import Data.Word
import Control.Monad
import System.Environment
import Data.Array.Repa as R
import Data.Array.Repa.IO.BMP
import Data.Array.Repa.IO.DevIL
import Data.Array.Repa.Stencil
@joaopizani
joaopizani / gist:2718522
Created May 17, 2012 12:15
Little bash snippet for converting audio formats to MP3
IFS=$'\n'; for i in $(find /media/midia/musicas -type f -name '*.wma'); do
mplayer -vc dummy -vo null -ao pcm:fast:file=/tmp/tmp.wav $i
lame /tmp/tmp.wav $(dirname $i)/$(basename $i .wma).mp3
done; rm /tmp/tmp.wav; unset $IFS
@joaopizani
joaopizani / .screenrc
Created May 17, 2012 11:55
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@joaopizani
joaopizani / .vimrc
Created April 19, 2012 02:05
A simple but useful .vimrc
" Some simple customization that should not depend on plugins.
" Mostly UI tweaks, mappings and segregation of backup files.
" Some mappings trigger plugin actions, but if the plugins are not installed
" you can just avoid using these (few) mappings.
" where your segregated vim metafiles should all reside - change if you want
let $VIMROOT = expand("$HOME") . "/vimfiles"
set nocompatible
filetype plugin indent on