This file contains 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
(def ptrn | |
{ | |
:a {:pattern #"a(?!b)" | |
:purpose "Only allow a if it is not preceded by a 'b' (negative lookahead)" | |
:samples ["acdefg" ; ok | |
"abcdef" ; nil | |
]} | |
:b {:pattern #"(?i)(<title.*?>)(.+?)(</title>)" |
This file contains 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
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
This file contains 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
#RaspberryPiAP | |
http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=27005 | |
http://raspberry-at-home.com/hotspot-wifi-access-point/ | |
http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/ | |
http://mgalgs.github.io/2011/12/08/creating-arch-linux-packages-by-hand.html |
This file contains 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 BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
import SocketServer | |
class S(BaseHTTPRequestHandler): | |
def _set_headers(self): | |
self.send_response(200) | |
self.send_header('Content-type', 'text/html') | |
self.end_headers() | |
def do_GET(self): |
This file contains 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
# Total Commits per author | |
git shortlog -sn | |
# Author total addition and substraction | |
git log --numstat --pretty="%H" --author="Sinister Light" | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}' | |
# Number of lines per author | |
git ls-files | xargs -n1 -d'\n' -i git blame {} | perl -n -e '/\s\((.*?)\s[0-9]{4}/ && print "$1\n"' | sort -f | uniq -c -w3 | sort -r |
This file contains 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
su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm | |
su -c "yum install freetype-freeworld" | |
gsettings "set" "org.gnome.settings-daemon.plugins.xsettings" "hinting" "slight" | |
gsettings "set" "org.gnome.settings-daemon.plugins.xsettings" "antialiasing" "rgba" | |
echo "Xft.lcdfilter: lcddefault" > ~/.Xresources | |
#reboot | |
#xrdb -query | |
#Xft.antialias: 1 |
This file contains 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
function success(position) { | |
} | |
function error() { | |
} | |
if (navigator.geolocation) navigator.geolocation.getCurrentPosition(success, error); | |
else error(); |
This file contains 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
function asyncForEach(array, iterator, then) { | |
function loop(i) { | |
if (i < array.length) { | |
iterator(array[i], function() { | |
loop(i + 1); | |
} | |
else { | |
then(); | |
} | |
} |
This file contains 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
(function quine() { console.log('(' + quine.toString() + ')()') })() |
This file contains 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
rvm implode | |
brew update | |
brew install rbenv | |
brew install ruby-build | |
rbenv init - | |
echo 'eval "$(rbenv init -)"' >> ~/.zshrc | |
rbenv install 1.9.3-p429 | |
rbenv rehash |
NewerOlder