Skip to content

Instantly share code, notes, and snippets.

View basilio's full-sized avatar

Basilio Cáceres basilio

View GitHub Profile
### Keybase proof
I hereby claim:
* I am basilio on github.
* I am basilio (https://keybase.io/basilio) on keybase.
* I have a public key whose fingerprint is E592 2A38 42D4 C2F3 1A0C 61BC 3A49 9316 C657 9905
To claim this, I am signing this object:
@basilio
basilio / sed-file-replaces
Created July 6, 2013 17:53
multiple file replaces using sed
# Make global replaces in multiples sql files, using sed
# Tested on Mac OSX
for x in *.sql; do sed -i '' 's/currentText/newText/g' ${x//.sql}.sql; done
@basilio
basilio / compile less
Created June 20, 2013 13:50
Compile less with inotify
# Compile less with inotify
## Detect all changes on every files in the less folder
## Compile the master less file, where you call all less files
## Update the css output file
/path/to/less/ IN_MODIFY lessc /path/to/less/compiler.less /path/to/css/style.css
# Minified
/path/to/less/ IN_MODIFY lessc --yui-compress /path/to/less/compiler.less /path/to/css/style.min.css
@basilio
basilio / gist:1317108
Created October 26, 2011 17:39
add watermark to images with imagemagick (command line)
// Create a watermark image (watermark.png) and place in folder
// Run this script on command line. It generates an image-wm.png for each image.png
for x in *.png; do composite -gravity Center watermark.png $x ${x//.png}-wm.png; done
@basilio
basilio / gist:1177170
Created August 28, 2011 20:20
convert color images to grayscale with imagemagick (command line)
for x in `ls *.*`; do `convert -type Grayscale $x $x`; done
@basilio
basilio / URL create google docs
Created December 3, 2010 02:22
Links to create docs on google
New Document
http://docs.google.com/document/create?hl=en
New Spreadsheet
http://spreadsheets.google.com/ccc?new&hl=en
New Presentation
https://docs.google.com/present/create
/**
* Sort bookmarks by rating
*/
function av_sort_bookmarks_by_rating($links){
foreach($links as $item) $new_list_links[$item->link_rating] = $item;
sort($new_list_links);
return $new_list_links;
}
add_filter("get_bookmarks", "av_sort_bookmarks_by_rating");
@basilio
basilio / Link to toggle element
Created August 17, 2010 22:40
// Link to toggle element width jQuery
for i in *.png; do convert $i -resize 50x50 $i.jpg; done