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 | |
### ABOUT | |
### Runs rsync, retrying on errors up to a maximum number of tries. | |
### Simply edit the rsync line in the script to whatever parameters you need. | |
# Trap interrupts and exit instead of continuing the loop | |
trap "echo Exited!; exit;" SIGINT SIGTERM | |
MAX_RETRIES=50 |
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
" Vim indent file | |
" Language: Yaml | |
" Author: Ian Young | |
" Get it bundled for pathogen: https://github.com/avakhov/vim-yaml | |
if exists("b:did_indent") | |
finish | |
endif | |
"runtime! indent/ruby.vim | |
"unlet! b:did_indent |
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
# Connects Jekyll with Lychee (http://lychee.electerious.com/) | |
# | |
# # Features | |
# | |
# * Generate album overview and link to image | |
# * Caching of JSON data | |
# | |
# # Usage | |
# | |
# {% lychee_album <album_id> %} |
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 | |
# Shotwell RAW metadata migrator | |
# | |
# This software is provided WITHOUT WARRANTY OF ANY KIND | |
# | |
# Shotwell doesn't write metadata to RAW files. This was a problem when I wished to migrate all my data out of Shotwell. | |
# This script pulls data out of Shotwell's database and writes it to the files using exiftool. | |
# This is not elegant, performant, or well-tested. However, it seems to get the job done! | |
# |
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
source "test/fixtures/my_rubygems_fixture", type: "json_fixture" do | |
gem "whatever" | |
gem "foobar", "~> 1.0.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
# | |
#= dump database to yaml for fixtures | |
# | |
# originated by elm200 <http://d.hatena.ne.jp/elm200/20070928/1190947947> | |
# | |
#== install | |
# | |
# move this file to RAILS_ROOT/lib/tasks/extract_fixtures.rake | |
# | |
namespace :db do |
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
Here are the version numbers available for Handlebars.js | |
+--------------+------------------+------------------+--------------+ | |
| npm versions | Official website | GitHub downloads | Git tags | | |
+--------------+------------------+------------------+--------------+ | |
| 1.0.2beta | 1.0.0-rc.3 | 0.9.0.pre.2 | 0.9.0.pre.4 | | |
| 1.0.4beta | | 0.9.0.pre.3 | 1.0.0.beta.1 | | |
| 1.0.5beta | | 0.9.0.pre.4 | 1.0.0-rc.3 | | |
| 1.0.6 | | 0.9.0.pre.5 | 1.0.rc.1 | | |
| 1.0.6-2 | | 0.9.0.pre.js | 1.0.rc.2 | |
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
test: | |
for f in test-*.coffee; do coffee "$$f"; done | |
.PHONY: test |
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
module ABHelper | |
def split_test(name) | |
experiment = YAML.load_file("config/experiments.yml")[name] | |
given_probability, num_with_probability = experiment[:variants].inject([0,0]) do |a,v| | |
p, n = a | |
if v.kind_of?(Hash) && v[:percent] | |
[p + v[:percent], n + 1] | |
else | |
a |
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
def with_var(variable, value, &block) | |
old_value = eval variable | |
eval "#{variable} = #{value.inspect}" | |
ret = block.call | |
eval "#{variable} = #{old_value.inspect}" | |
ret | |
end | |
# Usage | |
# ===== |