Skip to content

Instantly share code, notes, and snippets.

View xtranophilist's full-sized avatar

Dipesh Acharya xtranophilist

View GitHub Profile
@xtranophilist
xtranophilist / imdb-getglue.js
Last active April 12, 2017 17:06
Opens up relative GetGlue Page for the current IMDB page
slugify=function(str){
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@xtranophilist
xtranophilist / install-mscorefonts.sh
Created December 27, 2012 14:28
Install 'Times New Roman' and other proprietary fonts in Fedora
yum install rpm-build cabextract ttmkfdir
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec
rpmbuild -bb msttcorefonts-2.5-1.spec
rpm -ivh $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm
fc-cache -f -v
@xtranophilist
xtranophilist / 10-synaptics.conf
Last active October 12, 2015 22:28
My Synaptics Touchpad Configuration for Xorg
#vi /etc/X11/xorg.conf.d/10-synaptics.conf
#Supports Horizontal and Vertical Edge Scrolling, Two Finger Right click (tested on Dell XPS)
Section "InputClass"
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "VertEdgeScroll" "on"
Option "HorizEdgeScroll" "on"
@xtranophilist
xtranophilist / transfer.py
Created October 19, 2012 11:20
Script to transfer a website from one host to another. Moves files with FTP and MySQL data with dumping and importing.
#!/usr/bin/python
#SSH into the new server, and run this from the home directory. Granted ~/public_html is the Apache DocumentRoot for
#the user
import getpass
import os
print '\nThis script will automate the process of moving a website from one server to another.'
@xtranophilist
xtranophilist / .zshrc
Last active June 29, 2023 14:35
My zsh aliases
alias ..='cd ..'
alias cl="clear; ls"
alias ft='find / -type f -exec grep -i $1 {} +'
alias gp='git push'
alias gpp='git pull; git push'
alias gsc='gs; gca'
alias gscp='gs; gca; gp'
alias gu='git pull'
alias jj='java -jar'
alias k8000="fuser -k -n tcp 8000"