Skip to content

Instantly share code, notes, and snippets.

View gonzaloserrano's full-sized avatar
☁️
🧑‍💻

Gonzalo Serrano gonzaloserrano

☁️
🧑‍💻
View GitHub Profile
@gonzaloserrano
gonzaloserrano / twitter-filter.js
Created May 31, 2012 07:13
hide retweets and replies in twitter
$('.twitter-atreply').parents('.stream-item').fadeTo(0, .5); $('div[data-retweet-id]').parent().fadeTo(0, .5);
@gonzaloserrano
gonzaloserrano / bookmarklet-twitter-hider.js
Created May 31, 2012 07:25
bookmarklet for "hide retweets and replies in twitter"
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('.twitter-atreply').parents('.stream-item').fadeTo(0,%20.5);%20$('div%5Bdata-retweet-id%5D').parent().fadeTo(0,%20.5);%7D);
@gonzaloserrano
gonzaloserrano / gist:2845396
Created May 31, 2012 18:53
twitter-hider js
javascript:(function(){$('.twitter-atreply').parents('.stream-item').fadeTo(0,.5);$('div[data-retweet-id]').parent().fadeTo(0,.5);})();
@gonzaloserrano
gonzaloserrano / f11
Created March 1, 2013 11:08
Download all numbers of the f11 photography magazine http://www.f11magazine.com/site/all.html
for i in `curl http://www.f11magazine.com/site/all.html | grep "site\/pdf" | awk -F '"' '{print $2}'`; do echo $i; wget "$i"; done;
@gonzaloserrano
gonzaloserrano / gist:5496751
Last active December 16, 2015 20:59
Download some computer science videos popular in the HackerNews community
# requires python, use at your own risk :-)
mkdir youtube-dl
cd youtube-dl
wget http://youtube-dl.org/downloads/2013.05.01/youtube-dl
chmod +x youtube-dl
wget https://dl.dropboxusercontent.com/u/16897247/cs-videos.txt
for i in `cat cs-videos.txt | awk '{print $1}'`; do ./youtube-dl $i; done;
@gonzaloserrano
gonzaloserrano / gist:5944925
Created July 7, 2013 20:58
Remove node installed from dmg
#! /bin/bash
# needed this to install it from homebrew formula like http://madebyhoundstooth.com/blog/install-node-with-homebrew-on-os-x/
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read i; do
sudo rm /usr/local/${i}
done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
" Port of my favorite theme Made of Code by Mark Dodwell
" For Textmate Theme visit - http://madeofcode.com/posts/29-photo-my-new-textmate-theme-8220-made-of-code-8221-mdash-download-9-feb-2010-update-t
" Vim color file
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
@gonzaloserrano
gonzaloserrano / git-vendor
Last active December 20, 2015 15:29
Execute git commands in all vendors. Display git repo name, branch, repo status (modified, committed, added and untracked files) and file path.
#! /bin/bash
# modify the find target directory as needed
#legend
echo -e " \033[1;31;m● Modified \033[32;m● Committed \033[34;m● Added \033[1;30;m● Untracked"
echo
i=0
for VENDOR in `find vendor/socialpoint -type d -name .git`; do
@gonzaloserrano
gonzaloserrano / gist:6448036
Created September 5, 2013 09:38
Monitor cassandra inserts/updates/deletes
while; do nodetool tpstats | grep MutationStage; sleep 1; done;
@gonzaloserrano
gonzaloserrano / gist:6594400
Created September 17, 2013 13:38
How to less stderr
# http://stackoverflow.com/questions/2342826/how-to-pipe-stderr-and-not-stdout
# This creates a new file descriptor (3) and assigns it to the same place as 1 (stdout),
# then assigns fd 1 (stdout) to the same place as fd 2 (stderr) and finally assigns fd 2 (stderr)
# to the same place as fd 3 (stdout). Stderr is now available as stdout and old stdout preserved in stderr.
command 3>&1 1>&2 2>&3