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
background yes | |
font Inconsolata:size=9 | |
use_xft yes | |
xftalpha 0.8 | |
update_interval 2.5 | |
total_run_times 0 | |
own_window yes | |
own_window_type override | |
own_window_transparent yes | |
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager |
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
// Auto-update proof of concept | |
// embedding the update step into the | |
// current and new executables ahead of | |
// time, we don't need any extra scripts. | |
// It works by calling the new executable | |
// to rename the old one, and call the | |
// old one to rename the new one, execute | |
// it and exit. Finally the renamed new | |
// one removes the old one and runs normally. | |
// Process: |
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 | |
# Note that this goes under your github bare repo /hooks/ | |
work=$(mktemp -d) | |
out=/http/ | |
jekyll=/usr/share/ruby/2.3.0/bin/jekyll | |
while read oldrev newrev refname | |
do | |
branch=`echo $refname | cut -d/ -f3` |
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
javascript:(function(){a=document.getElementsByTagName('a');for(i=0;i<a.length;i++){b=a[i].href.split('http://');a[i].href='http://'+b[b.length-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 | |
if [ $(id -u) != 0 ]; then | |
exec sudo -- "$0" "$@" | |
else | |
cat /etc/pacman.d/mirrorlist.pacnew | awk -v RS='\n\n' '/^## United States/{print $0}' | awk '/^#Server/{print substr($0, 2)}' | rankmirrors - > /etc/pacman.d/mirrorlist | |
rm /etc/pacman.d/mirrorlist.pacnew | |
fi | |
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/env python | |
def enforce(func): | |
''' Decorator to enforce type decorators at runtime via | |
type assertion. Usage: | |
@enforce | |
def foo(a : str, b : int, c = True : bool) -> str: | |
return None | |
''' | |
def enforce_wrapper(*args, **kwargs): |
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
pkgname=('pacman-mirrorlist-hook') | |
pkgver=1 | |
pkgrel=1 | |
pkgdesc='Pacman mirrorlist hook.' | |
arch=('any') | |
depends=('pacman' 'pacman-mirrorlist') | |
source=('pacman-mirrorlist.hook' 'rank-mirror-list.sh') | |
md5sums=('b51e1a45b23b2831709e7732fe88d4c8' | |
'5cceded6741d705fd09b919de9e1234b') |
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
# Usage: | |
#FROM u8sand/archlinux-devel-yaourt | |
#RUN echo "Instaling dependencies..." | |
#RUN pacman -Sy --noconfirm && sudo -u docker yaourt -S --noconfirm all your packages | |
# | |
# Your scripts | |
# | |
#Optional: Remove privileged account for security reasons | |
#RUN userdel -r docker && rm /etc/sudoers.d/docker |
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/sh | |
HOME="/home/${USER}" | |
PROFILE="${HOME}/.profile" | |
install_env() { | |
ENV_CMD="$1" | |
ENV_URL="$2" | |
ENV_ROOT="${HOME}/.${ENV_CMD}" | |
ENV_CMD_ROOT="$(echo ${ENV_CMD} | tr /a-z/ /A-Z/)_ROOT" |
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 sh | |
# Parse a normal uri--e.g. http://user:pass@host:1234 into a custom perl-based substitution format. | |
# e.g. parse_uri "http://localhost:80" '$+{port}' ==> 80 | |
function parse_uri() { | |
URI=$1 | |
FMT=$2 | |
echo ${URI} | perl -pe "s#(?<proto>[\w\+-]+)://((?<user>[-\w]+):(?<pass>[-\w]+)@)?((?<host>[-\w]+)(:(?<port>\d+))?)#${FMT}#g" | |
} |