mkdir -p $HOME/build/
cd $HOME/build/
git clone https://aur.archlinux.org/gcc49.git
cd gcc49
makepkg --syncdeps
sudo pacman --upgrade gcc-4.9.3-1-x86_64.pkg.tar.xz
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
#!/usr/bin/env python | |
# | |
# author: syl20bnr (2013) | |
# goal: Focus the nth window in the current workspace (limited to 10 firsts) | |
# | |
# Example of usage in i3 config: | |
# | |
# bindsym $mod+0 exec focus_win.py -n 0 | |
# bindsym $mod+1 exec focus_win.py -n 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
#lang racket/base | |
(define (signed-var-int val) | |
(cond | |
[(bitwise-bit-set? val 31) | |
(bitwise-ior val (bitwise-not #xffffffff))] | |
[else | |
val])) | |
(define (read-var-int in) |
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
# INCORRECT! DON'T DO THIS! | |
>>> x = "www.alliancefrançaise.nu" # This is the problematic line. Forgot to make this a Unicode string. | |
>>> print x | |
www.alliancefrançaise.nu | |
>>> x.encode('punycode') | |
'www.Alliancefranaise.nu-h1a31e' | |
>>> x.encode('punycode').decode('punycode') | |
u'www.Alliancefran\xc3\xa7aise.nu' | |
>>> print x.encode('punycode').decode('punycode') | |
www.alliancefrançaise.nu |
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
#!/usr/bin/env python | |
""" | |
Last.fm scrobbling for Pianobar, the command-line Pandora client. Requires Pianobar, Python, pyLast and Last.fm API credentials. | |
https://github.com/PromyLOPh/pianobar/ | |
http://code.google.com/p/pylast/ | |
http://www.last.fm/api/account | |
Installation: | |
1) Copy this script and pylast.py to the Pianobar config directory, ~/.config/pianobar/, and make sure this script is executable |
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 4chan() { | |
if [[ $# -ne 1 ]] | |
then | |
echo 'No URL specified! Give the URL to the thread as the ONLY argument' | |
return 1 | |
fi | |
# This should look something like: g/thread/73097964 | |
urlPrimative=$(grep -o '[0-9a-zA-Z]\{1,4\}/thread/[0-9]*' <<< $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
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
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
<?php | |
function pingMCServer($server,$port=25565,$timeout=2){ | |
$socket=socket_create(AF_INET,SOCK_STREAM,getprotobyname('tcp')); // set up socket holder | |
socket_connect($socket,$server,$port); // connect to minecraft server on port 25565 | |
socket_send($socket,chr(254).chr(1),2,null); // send 0xFE 01 -- tells the server we want pinglist info | |
socket_recv($socket,$buf,3,null); // first 3 bytes indicate the len of the reply. not necessary but i'm not one for hacky socket read loops | |
$buf=substr($buf,1,2); // always pads it with 0xFF to indicate an EOF message | |
$len=unpack('n',$buf); // gives us 1/2 the length of the reply | |
socket_recv($socket,$buf,$len[1]*2,null); // read $len*2 bytes and hang u[ | |
$data=explode(chr(0).chr(0),$buf); // explode on nul-dubs |
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
# ignore everything | |
* | |
!.gitignore | |
# except PKGBUILD needed files | |
!PKGBUILD | |
!*.install | |
!ChangeLog | |
# common wing-man files |
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
<?php | |
if(defined('WP_CRON_CUSTOM_HTTP_BASIC_USERNAME') && defined('WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD')) { | |
function http_basic_cron_request($cron_request) { | |
$headers = array('Authorization' => sprintf('Basic %s', base64_encode(WP_CRON_CUSTOM_HTTP_BASIC_USERNAME . ':' . WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD))); | |
$cron_request['args']['headers'] = isset($cron_request['args']['headers']) ? array_merge($cron_request['args']['headers'], $headers) : $headers; | |
return $cron_request; | |
} |