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
⏪🎄 | |
🤫🌃👼🌃 | |
0🎄 | |
🔴👃🏽🦌 | |
❄⚪👗 | |
🤫🌨 | |
0😀 | |
🧒🏽🧒🏻🏃🏽♂️ | |
🚗🏡4🎄 | |
🛎🔔🛎🛎 |
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
Personal most used commands in vim (VSCode, Atom, ... any editor really) | |
# motion.txt | |
y c d ... yank / change / delete | |
v V ... visual mode character-wise/Line-wise | |
< > ... indent and outdent | |
/ ? ... search forward or backwards, | |
eg "/word" => go to "word" |
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: provide a list (Array) of package objects | |
# package.version must contain the version string, e.g. "1.0.0e-1ubuntu3.4" | |
# Method 1: simple | |
# blow up all numbers | |
def sort_packages list | |
list.map do |x| | |
[ x, x.version.gsub(/[0-9]+/){|z| "%010x" % z} ] | |
end. | |
sort{|x,y| x[1] <=> y[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) |
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
# -*- 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
# 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
# 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
#!/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
# git config; arlimus, public domain | |
## Make your adjustments | |
######################## | |
[user] | |
name = Your Name | |
email = your.name@email.com | |
[core] |
NewerOlder