Skip to content

Instantly share code, notes, and snippets.

@seeRead
seeRead / httpd-vhosts.conf
Created May 15, 2014 15:38
ApacheConf Vhost file at /etc/apache2/extra/httpd-vhosts.conf
# Virtual Hosts
NameVirtualHost *:80
<Directory "/Users/seeread/Sites/">
Options Indexes MultiViews +FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# gem install pp awesome_print map_by_method what_methods duration wirble ori awesome_print
# Interactive Ruby console configuration
# use x = _ to assign to last output
# use ; to prevent return of data
# use 'method' to determine where a method is defined
# e.g. User.method(:acts_as_commentable)
IRB_START_TIME = Time.now
# Print to yaml format with "y"
@seeRead
seeRead / owl-carousel-arrows
Created April 23, 2014 19:26
some svg arrows for owl carousel
import re
import pprint
import urlparse
import urllib2
#http://blog.ianbicking.org/2008/12/10/lxml-an-underappreciated-web-scraping-library/
from lxml.html import parse, tostring, fromstring #for better css selectors than Beautiful Soup
from lxml.html.diff import htmldiff
from lxml import cssselect, etree
from urlparse import urlparse
from pytz import timezone
@seeRead
seeRead / gitpage_to_repo.js
Last active December 17, 2015 14:59
jump from github page to repo via bookmarklet
//jump from github page to github repo quickly (some peeps don't link)
javascript:{var a=location.href.split('/'), b = a[2].split('.'); a = a.slice(-2)[0];b= b[0];a="http://github.com/"+b+"/"+a;location.href=a;}
@seeRead
seeRead / dual-language-bookmarklet.js
Last active December 14, 2015 20:29
bookmarklet for side-by-side viewing of original and google-translated content tested in chrome & firefox(?)
// useful bookmarklet for side-by-side viewing of original and translated content (tested in chrome and firefox?)
// adapted from http://www.chromeplugins.org/plugins/google-chrome-dual-view/
// use as you like
// http://seeread.info
javascript:a=location.href;b='http://translate.google.de/translate?u='+a+'&hl=en&langpair=auto|en&tbb=1';f='<frameset cols=\'*,*\'>\n<frame src=\''+a+'\'/>';f+='<frame src=\''+b+'\'/>\n';f+='</frameset>';with(document){write(f);void(close())};
@seeRead
seeRead / r_install.sh
Created October 4, 2012 14:55
r init file
#/bin/bash
# run chmod +x THIS_GIST.sh
# configure for debian or ubuntu! debian has dependencies that ubuntu's libs will conflict with
# sources:
# http://cran.r-project.org/bin/linux/debian/
# http://cran.r-project.org/bin/linux/ubuntu/README
# http://stackoverflow.com/questions/10255082/installing-r-from-cran-ubuntu-repository-no-public-key-error
clear
# http://stackoverflow.com/questions/1189759/expert-r-users-whats-in-your-rprofile
#set cran repo
r <- getOption("repos") # hard code the US repo for CRAN
r["CRAN"] <- "http://cran.us.r-project.org"
options(repos = r)
rm(r)
#persistent RHistory
.Last <- function() {
if (!any(commandArgs()=='--no-readline') && interactive()){
@seeRead
seeRead / xorg.conf
Created June 30, 2012 21:15
my weekend's pride
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 302.17 (buildd@rhenium) Sun Jun 17 23:26:33 UTC 2012
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
#!/bin/bash
# boot_enhancer.sh
# also see Bootchart http://www.bootchart.org/
# source http://www.ubuntubuzz.com/2012/01/how-to-increasespeed-up-ubuntu-booting.html
first_half()
{
sudo apt-get -y install prelink # http://ubuntuforums.org/showthread.php?t=832615
sudo /etc/cron.daily/prelink
sudo apt-get -y install preload # http://ubuntuforums.org/showthread.php?t=832615
sudo sed -i 's/PRELINKING\=unknown/PRELINKING\=yes/g' /etc/default/prelink