Skip to content

Instantly share code, notes, and snippets.

View axolx's full-sized avatar
🐝

Martin Rio axolx

🐝
View GitHub Profile
@axolx
axolx / instagram_unfollow.py
Created November 10, 2013 02:07
My Instagram account got hacked and next time I logged in I was following >500 spammers. Instead of using the UI to unfollow them (painfully slow) I put together this little script.
from instagram.client import InstagramAPI
from instagram.bind import InstagramAPIError, InstagramClientError
from time import sleep
access_token = "SETMET"
api = InstagramAPI(access_token=access_token)
follows = api.user_follows(MY_USERID)
for user in follows[0]:
print "Unfollowing: " + user.username
@axolx
axolx / ombu-ports
Created October 29, 2012 17:53
Macports for OMBU team member
file
php5 +fastcgi +pear +apache2
php5-mysql
php5-solr
php5-soap
php5-openssl
php5-gd
php5-curl
git-core
mercurial
@axolx
axolx / gist:3068001
Created July 7, 2012 20:29
Python multiprocessing example: run a function 7 times on a 5 process pool
import multiprocessing
import time
from random import randint
PROCESSES = 5
WORKER_CALLS = 7
def worker(num):
"""worker function"""
print 'Starting worker', num
@axolx
axolx / gist:986265
Created May 23, 2011 05:29
Pull & update all git or mercurial repos in a directory (e.g. vim pathogen bundles)
for d in `ls -1`; do
if [ -d $d/.git ]; then
cd $d
git pull
cd ..
elif [ -d $d/.hg ]; then
cd $d
hg pull -u
cd ..
else
@axolx
axolx / psdtojpeg.sh
Created March 23, 2011 19:24
Convert all PSD files in a directory to JPG
#! /bin/sh
#############################################
# Convert all PSD files in a directory to JPG
#
# Author: Martin Rio
# Version: 0.1 (3/23/2011)
# Dependencies:
# - ImageMagick's convert utility
#############################################