This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install abiword chromium-browser gimp gftp icoutils keepassx python-gpgme ssh xclip | |
# drivers | |
sudo apt-get install brother-lpr-drivers-extra | |
# dev | |
sudo apt-get install curl git gitk htop phantomjs python-pip mysql-server r-base vim | |
# Apache | |
sudo apt-get install apache2 libapache2-mod-fcgid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
icotool -o favicon.ico -c favicon.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import pandas as pd | |
def fix(url): | |
# remove www subdomain | |
url = url.replace('://www.', '://') | |
# add slash if URL doesn't end with .html | |
if not url.endswith('html'): | |
url = url.rstrip('/') + '/' | |
return url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.modal { | |
width:38%; /* desired relative width */ | |
left:31%; /* (100%-width)/2 */ | |
height:56%; /* desired relative height */ | |
top:22%; /* (100%-height)/2 */ | |
margin:auto; /* place center */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href="'+document.location.pathname+'"]').parent('li').attr('class', 'active') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils import timezone | |
import time | |
# feed = object from DB | |
# doc = parsed feedparser object | |
feed.updated_at = doc.feed.get('updated_parsed', timezone.now()) | |
if isinstance(feed.updated_at, time.struct_time): | |
feed.updated_at = timezone.make_aware( | |
timezone.datetime(*feed.updated_at[:-3]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create user and database with user as admin | |
sudo -u postgres createuser -D -A -P uname | |
sudo -u postgres createdb -O uname dbname | |
# delete database and user | |
sudo -u postgres dropdb dbname | |
sudo -u postgres dropuser uname | |
# dump and import data | |
pg_dump --clean -U uname dbname > dump.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input').each(function(){$(this).attr('checked', false)}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# requires: pattern http://www.clips.ua.ac.be/pages/pattern | |
from pattern.web import * | |
import csv | |
import itertools | |
# engine = Google(license='XXX', throttle=2.0) | |
#engine = Twitter(license=None) | |
engine = Bing() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://coding.smashingmagazine.com/2012/10/29/powerful-command-line-tools-developers/ | |
alias tunnel='sshuttle -D --pidfile=/tmp/sshuttle.pid -r <server> --dns 0/0' | |
alias stoptunnel='[[ -f /tmp/sshuttle.pid ]] && kill `cat /tmp/sshuttle.pid`' |