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
# -*- coding: UTF-8 -*- | |
def | |
require # what? | |
end | |
%w(open-srx gnmt). # interesting... | |
each_with_index{ | |
|a, а| (42**а*1337). # some magic numbers there - wait... |a, a| really? | |
times {a.succ!} |
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
# spec/support/capybara/select2_helper.rb or features/support/select2_helper.rb | |
module Select2Helper | |
# @example | |
# select2 "Item", from: "select_id" | |
# select2 /^Item/, from: "select_id" | |
# | |
# @note Works with Select2 version 3.4.1. | |
def select2(text, options) | |
find("#s2id_#{options[:from]}").click |
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 | |
# A little Bash script to make a mirror of your Github repositories and keep | |
# them up-to-date. | |
# Why mirroring? Because I can! | |
# Also, it will be very useful if one day a meteorite crashes into Github | |
# servers (even if it will not happen). | |
# https://gist.github.com/950441 |
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 | |
set -euxo pipefail | |
cd "$(dirname "$0")" | |
target="${1:-hockeypuck}" | |
interactive="${2:-}" | |
container=${target}-builder | |
volume=/root/HOST |
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 | |
# Sometimes, you realize you have really rubbish songs in your library for some reason. | |
# This script allows you to get rid of them just by hitting ./mpd-delete-current-song.rb on your command line. | |
# It will backup the file to TRASH, then remove it from MPD's library and finally skip to next song. | |
# https://gist.github.com/1341895 | |
require 'socket' | |
require 'fileutils' |
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
# See https://github.com/bbatsov/rubocop | |
# Add this to the top of your .rubocop.yml: | |
# inherit_from: | |
# - https://gist.githubusercontent.com/infertux/cdd2ccc6e0a0cd94f458/raw | |
# AllCops | |
AllCops: | |
TargetRubyVersion: 2.3 |
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 -eu | |
cd /var/lib/collectd/rrd/$HOST | |
for f in $(find -name *.rrd); do | |
echo "rrdtool dump $f" | |
rrdtool dump $f > ${f%.rrd}.xml | |
done | |
rsync -avz --exclude *.rrd /var/lib/collectd/rrd/$HOST/ $COLLECTD_HOST:/var/lib/collectd/rrd/$HOST/ |
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
(2 * 2 * 5 * 7 * 37 * 149 * 5417 * 148781 * 51939996061871).to_s(16).scan(/../).map { |x| x.hex.chr }.join |
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
class CheckOut | |
def initialize(rules) | |
@items = Hash.new { 0 } | |
@pricer = Pricer.new(rules) | |
end | |
def scan(sku) | |
@items[sku] += 1 | |
end |
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
--- V3.car 2015-09-18 09:21:11.000000000 +0000 | |
+++ V3.car 2016-04-01 14:51:17.783726416 +0000 | |
@@ -61,16 +61,16 @@ | |
#--------------------------- | |
[ hover ] | |
-hAbove = 2.5 | |
+hAbove = 4.0 | |
hRayLen = 4.0 | |
NewerOlder