I hereby claim:
- I am michaelglass on github.
- I am glass (https://keybase.io/glass) on keybase.
- I have a public key whose fingerprint is 49AF 48CA BE8F AA22 8753 E158 8D8A C6D3 0FBD 81CD
To claim this, I am signing this object:
public class NestedForLoop { | |
public static void main(String[] args) { | |
int numRows = 4; | |
int numColumns = 7; | |
int[] columnSums = new int[numColumns]; | |
for (int row = 0; row < numRows; row++) { | |
int rowSum = 0; | |
for (int column=0; column < numColumns; column++) { | |
int value = row * column; | |
System.out.print(value + "\t"); |
I hereby claim:
To claim this, I am signing this object:
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
if Dir.pwd == '/vagrant' | |
Guard::UI.info 'detected vagrant, enabling force polling' | |
Guard.options[:force_polling] = true | |
Guard.listener.options[:force_polling] = true | |
end | |
guard 'rspec', cmd: 'zeus rspec', all_on_start: false, all_after_pass: false do | |
#... |
module AlertConfirmer | |
class << self | |
def reject_confirm_from &block | |
handle_js_modal 'confirm', false, &block | |
end | |
def accept_confirm_from &block | |
handle_js_modal 'confirm', true, &block | |
end |
#!/bin/bash | |
cd config | |
for link_me in application database; do | |
ln -sf $link_me.yml{.example,}; | |
done | |
cd .. |
# Deadlock Retryer | |
# ================ | |
# | |
# when you decorate a class with `retry_deadlocks_from :such_a_locker, :so_many_locks, :lock_it_to_me` | |
# the deadlocks will be retried using a small random delay. THIS MEANS THAT THEY CAN NO LONGER BE TREATED SYNCHRONOUSLY | |
module DeadlockRetryer | |
def retry_deadlocks_from(*method_names) | |
method_names -= retry_deadlocks.to_a | |
retry_deadlocks.merge method_names |
# encoding: UTF-8 | |
# by Eamon Nerbonne (from http://home.nerbonne.org/A-vs-An), Apache 2.0 license | |
class IndefiniteArticle | |
# Usage example: IndefiniteArticle.for("example ") | |
# example returns: "an" | |
# Note that the terminal space indicates this is a complete word - this is sometimes significant, particularly for acronyms! | |
DICT = "]08[09[0-11[0-4[0-4 ]0-6-[0-8[11[110]111]112]113]114]115]116]117]118]119]11.4]18[180]1800[1801[1802[1803[1804[1805[1806[1807[1808[1809[181-]181 ]182-]182 ]183-]183 ]184-]184 ]185-]185 ]186-]186 ]187-]187 ]188-]188 ]189-]189 ]8[800x]890]8,1]8,2]–i[#i[$11 [$11.[$18 [$18,[$18.[$8[&a[&o[*a[*e[*i[.av[.mp[.og[/a[/e[/h[/i[/l[/s/[@[`a[£8[∞[a[a ]abou]about-[agai]al-I]algu]alth]amon]an ]and]and\"[anda[ande[andr[anot]anyw]apart ]appears]apre]are ]are:]artí]A[A$]AAA]Akiz]Amar\"]Andaluc]Armat]Asturias]Athl]Athleti[Athlo[AU$]AUD]AUSC]Á[á[à[Ä[ā[Å[æ[Æ[Æn]Bhai[Bhá[Buddhism[contains[Chais[County,[das [dem [der [describes[Dinas[Diver-[Dún]e[e.g]each ]either ]either.]el-]ella]empez]enoug]eu]eup [e |
import sublime_plugin | |
import os | |
class RemoteTouch(sublime_plugin.EventListener): | |
def on_post_save(self, view): | |
file_name = view.file_name() | |
needle = "PATH_FOR_YOUR_APP" # change this | |
if needle in file_name: | |
project_root = view.window().folders()[0] | |
relative_path = file_name.replace(project_root + '/', "") |
# Deadlock Retryer | |
# ================ | |
# | |
# when you decorate a class with retry_deadlocks_from :such_a_locker, :so_many_locks, :lock_it_to_me | |
# the deadlocks will be retried using a small random delay. THIS MEANS THAT THEY CAN NO LONGER BE TREATED SYNCHRONOUSLY | |
module DeadlockRetryer | |
def retry_deadlocks_from(*method_names) | |
method_names -= retry_deadlocks.to_a | |
retry_deadlocks.merge method_names |
task :dj_throughput, roles: :delayed_job do | |
last_reported = Time.now | |
completed = {} | |
run "tail -f #{shared_path}/log/delayed_job.log" do |channel, stream, data| | |
host = channel[:host] | |
trap("INT") { puts 'Interupted'; exit 0; } | |
if data =~ /completed after/ | |
completed[host] ||= 0 | |
completed[host] += 1 | |
end |