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: | |
# eg have this in your html: | |
# <pre class="29c3"> | |
# N.O-T/M | |
# Y-D/E.P | |
# A/R.T-M | |
# E-N/T | |
# 2.9-C/3 | |
# </pre> | |
# then run this in javascript: |
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
# short version, just copy-and-paste this line: | |
pacman_aur(){ for pn in $*; do rm -rf /tmp/$pn; mkdir -p /tmp/$pn; pushd /tmp/$pn; wget https://aur.archlinux.org/packages/${pn:0:2}/$pn/PKGBUILD; makepkg; popd; done; sudo pacman -U $(for i in $*; do echo /tmp/$i/*.tar.xz; done;); } | |
# install yaourt on a fresh arch: | |
# 1. get requirements | |
pacman -S base-devel yajl sudo | |
# 2. make sure your user is added to sudoers | |
# as root: visudo | |
# 3. install package-query and yaourt from aur | |
pacman_aur package-query yaourt |
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
# arlimus i3 config; public domain | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
set $mod Mod4 | |
# Use Mouse+$mod to drag floating windows to their wanted position | |
floating_modifier $mod | |
# start a terminal | |
bindsym $mod+r exec TERMINAL=xfce4-terminal i3-sensible-terminal |
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
# git config; arlimus, public domain | |
## Make your adjustments | |
######################## | |
[user] | |
name = Your Name | |
email = [email protected] | |
[core] |
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 ruby | |
require 'fileutils' | |
threshold = 350e3 | |
$output = "minified" | |
$quality = 70 | |
FileUtils.mkdir_p $output | |
def conv org, factor = 1.0 | |
puts "-- converting with quality #{$quality}, resize #{(factor*100).round}%" |
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
# define the printer | |
def p_uni(range); r = Array(range); return if r.empty?; puts r[0..79].pack("U*").gsub(/\p{^Print}/,''); p_uni(r[80..-1]); end | |
# use it | |
p_uni(0x30..0x2e50) | |
# this will give you: | |
# 0123456789:;<=>?@ABCDEFGHIJKLMNO... | |
# ... | |
# ⸠⸡⸢⸣⸤⸥⸦⸧⸨⸩⸪⸫⸬⸭⸮ |
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
# get the SHA hash of the first commit in your git repo | |
git log --pretty=format:%H | tail -n1 | |
# put version 0.0 tag onto the first commit in your git repo | |
git tag 0.0 $(git log --pretty=format:%H | tail -n1 ) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
name = 'saucy' | |
IP = { | |
'saucy' => '192.168.123.123', | |
'client1' => '192.168.123.101', | |
'client2' => '192.168.123.102' | |
} |
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
## prerequisite: | |
## deploy https://github.com/ogom/cookbook-gitlab | |
## have repos in place (/home/git/repositories) | |
## have data in mysql | |
service gitlab stop | |
# we need ruby1.9.1 for old gitlab migration... | |
apt-get install -y libpq-dev ruby1.9.1 ruby1.9.1-dev | |
update-alternatives --set ruby /usr/bin/ruby1.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
# usage example with Grape: | |
# | |
# require 'kaminari' | |
# require 'sequel-kaminari' | |
# require 'api-pagination' | |
# ... | |
# desc "Get all items" | |
# paginate per_page: 25 | |
# get :items do | |
# paginate( DB[:items] ).all.map(&:to_hash) |
OlderNewer