Skip to content

Instantly share code, notes, and snippets.

View fabriceleal's full-sized avatar
😫
meh

Fabrice Ferreira Leal fabriceleal

😫
meh
  • Leiria, Portugal
View GitHub Profile
@fabriceleal
fabriceleal / gist:4703859
Created February 3, 2013 21:59
Replace text in-file
sed -i 's/old/new/g' file
@fabriceleal
fabriceleal / gist:4406991
Created December 29, 2012 13:40
Tar directory
tar -zcf dir.tar.gz dir
@fabriceleal
fabriceleal / gist:4406294
Created December 29, 2012 11:32
List all installed libraries
pkg-config --list-all
@fabriceleal
fabriceleal / gist:4406290
Created December 29, 2012 11:30
Get flags for compiling stuff with library
pkg-config --libs allegro-5.1
@fabriceleal
fabriceleal / gist:4391411
Created December 27, 2012 19:51
Implicit rule: For all targets, execute the same rule. Dependency has the same name as the target (give or take extension)
# Assumes that
# exe[n] is generated from exe[n].cpp
all: exe1 exe2 exe3
%: %.cpp
$(CC) $? -o $@ $(FLAGS)
@fabriceleal
fabriceleal / pegstuff.md
Created December 19, 2012 18:30
Parsing expression grammars - Links and stuff
@fabriceleal
fabriceleal / git_pull_all.sh
Created December 14, 2012 16:50
Pull all submodules
git submodule foreach git pull
@fabriceleal
fabriceleal / dbcc_reseed_table
Created December 12, 2012 10:31
reseed table
-- http://msdn.microsoft.com/en-us/library/ms176057.aspx
DBCC CHECKIDENT('table', reseed, 0)
sudo shutdown 0 -P
# -P power off after bring down
@fabriceleal
fabriceleal / gist:4250763
Last active October 13, 2015 20:18
Find files matching <pattern>
find / -name *asdf*
# find <start-dir> -name pattern
locate -i *asdf*
$ -i = ignore case distinctions