Skip to content

Instantly share code, notes, and snippets.

@gruis
gruis / localtunnel.rb
Created March 19, 2017 03:46
Run localtunnel in a restart loop
#!/usr/bin/env ruby
# Run localtunnel in a loop that will restart it if it crashes. When restarting
# due to consecutive crashes the loop will wait for an increasing period of
# time before starting localtunnel. You can control the wait time calculation
# with the `--backoff` option, and the `--wait` option.
#
# @see https://github.com/localtunnel/localtunnel/issues/81
#
# @example run on port 3000 with an auto assigned subdomain
@gruis
gruis / oxfam-jp-teams.rb
Created April 7, 2016 05:47
Oxfam JP Teams Summary
#!/usr/bin/env ruby
# - Retrieve data on all teams registered for Oxfam Japan trail hike
# - Print out the number of teams attempting each course
# - Print out the total fund raising target and total progress towards targets
#
# requires Faraday
# - gem install faraday
require 'json'
@gruis
gruis / afp.conf
Created March 11, 2016 04:48 — forked from dinigo/afp.conf
Install netatalk (afp) in Ubuntu with service announcing and provide a Time Machine share. Users must belong to `timemachine` group to be allowed to use it.
[TimeMachine]
path = /store/time-machine
time machine = yes
valid users = @timemachine
@gruis
gruis / dirtycop
Last active April 17, 2019 05:24 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
#
# Here are some options you can pass in addition to the ones in rubocop:
#
@gruis
gruis / keybase.md
Last active June 4, 2018 22:51
Keybase

Keybase proof

I hereby claim:

  • I am gruis on github.
  • I am simulacre (https://keybase.io/simulacre) on keybase.
  • I have a public key ASA1-P7TD9C7M4fYQJnlIgfRVA2DGe1Ri4tXfnVdfG8U3go

To claim this, I am signing this object:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArqNqtISknd/SnyNFppo+9x484VFZRTJoEpLMWcyPk9+bvRiiLkkZs3SUxjRrweBFvJUzRHqI9/KzPsvUXDzU1ngFU4V8M1yfQPt+kmouF8ZniSyB/lQUu8UZT9K4O3Eh123wj8kMS+KiBe3BV1YDBtQ8kjWnS8jMmyhY2S+msq64mK1cPFN60hNGfl5rFOHc9Uj+f/tFcBGO/UdguTLxlQ3w+RCXy2CQsSBOlaOmSrZAsLaCrIH2bZbBDeXxPvPyAKeufd8aM6n0wbLg3e83AsFSm+IOYaMgMJ89weLp78WngXb+5X3Jt/1y9HB1KbLH3rQz6yzr8DgoHduv3GfOow== calebcrane@Cubert.local
require 'rubygems'
require 'eventmachine'
children = []
Signal.trap('SIGINT') do
EventMachine.next_tick { EventMachine.stop_event_loop }
end
Signal.trap('EXIT') do
require 'rubygems'
require 'eventmachine'
children = []
Signal.trap('SIGINT') do
EventMachine.next_tick { EventMachine.stop_event_loop }
end
Signal.trap('EXIT') do
@gruis
gruis / Gemfile
Created November 19, 2012 14:49
Migrate nested SVN repositories to Git
source :rubygems
gem "svn2git", "~>2.2"