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
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
#!/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
@echo off | |
REM If you edit this file, make sure to run `unix2dos` to fix those fucking CRLF. | |
REM Let's keep this script as dumb as possible and do all the logic with a true language. | |
REM Basically, this should be no more than a sort of remote control. | |
echo Initializing hook... | |
:begin |
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 | |
# Cheap pomodoro timer | |
# https://en.wikipedia.org/wiki/Pomodoro_Technique | |
set -eu | |
trap bye INT TERM | |
bye() { |
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 | |
# Outputs some joyful hackers quotes. | |
# Count is 276 for v3.5-rc1-37-g99becf1 (2012-06-04). | |
# Path to the source | |
SOURCE=../Kernel | |
### |
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 | |
# This is a WTF Bash script licensed under the WTFPL license (what else?). | |
# WTF: | |
# 1. Watching http://youtu.be/lTx3G6h2xyA | |
# 2. "Hey, what a nice device..." | |
# 3. See http://amzn.com/B0046ZIZO8 | |
# 4. "Doh! $159! Way too expensive for a broke student... :/" | |
# 5. ... |
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
--color | |
--format d | |
--drb | |
--profile | |
--order random |
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 |
OlderNewer