Profile
Achievement
jarnaldich's Recent Snippets
- All /
« Prev 1 Next »
Making a python process exit with error code 1 after 30 seconds. Exit is unclean (no garbage is collected, no flushed buffers, etc...).
0
1185
posted 12 years ago by jarnaldich
Sometimes (ex. django templates section at setting.py), a function expects an absolute path, but it's more practical when developing to refer it to the current file position in our code base. The rel function does exactly that.
0
1329
posted 13 years ago by jarnaldich
replace foo -> bar in all .txt files down the tree
Dunno why, the syntax highlighter adds \3's to the code. Try plain text.
0
1019
posted 14 years ago by jarnaldich
Searches down the current directory every file whose name matches (case insensitively) {{file_pattern}} for the regexp {{text}}.
0
741
posted 14 years ago by jarnaldich
To rename a bunch of files from "*.foo" to "*.bar" (like windows' REN *.foo *.bar) in unix.
Looking at the solution, it is easy to adapt it to more powerful character substitutions on a 1 to 1 basis.
If you want to test what will be executed b...
0
883
posted 14 years ago by jarnaldich
Centering a div with css is easy, but there are some compatibility quirks...
1
975
posted 15 years ago by jarnaldich
Imports data from CSV (excel-compatible format) into MySQL. Also check the mysqlimport utility and the complementary SELECT ... INTO OUTFILE.
4
1107
posted 16 years ago by jarnaldich
Given an an associative list ((k1 . v1) (k2 . v2) ... (kn . vn)), with possibly equal values for ki, it returns another alist where all cells have distinct keys and where values originally associated to the same key have been grouped as a list in the...
1
979
posted 16 years ago by jarnaldich
MySQL backup and restore example through mysqldump / mysql command line utilities.
3
828
posted 16 years ago by jarnaldich