Save this as glucky-markdown.rb somewhere...
#!/usr/bin/env ruby
require 'uri'
require 'json'
require 'net/http'
def goog(msg)
class Derpbot9000 < RTanque::Bot::Brain | |
NAME = 'derpbot9000' | |
include RTanque::Bot::BrainHelper | |
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 1.0 | |
def tick! | |
turn_randomly | |
command.speed = MAX_BOT_SPEED | |
if (target = self.nearest_target) | |
self.fire_upon(target) |
class Derpbot9000 < RTanque::Bot::Brain | |
NAME = 'derpbot9000' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
turn_randomly | |
command.speed = MAX_BOT_SPEED | |
command.turret_heading = sensors.turret_heading - 0.1 | |
command.fire(0.1) | |
end |
# lib/download_counter.rb | |
def downloads_for(records) | |
ids = records.all.each.map(&:uuid).join(",") | |
JSON.parse(Excon.get("/downloads?uuids=#{ids}")) | |
end | |
# controller | |
def index | |
@episodes = Episode.find_all_by_whatever | |
@downloads = DownloadCounter.downloads_for(@episodes) |
-----BEGIN CERTIFICATE----- | |
MIIFSjCCBDKgAwIBAgIQdOaH8EhWNAjG4CztgBhDdjANBgkqhkiG9w0BAQUFADBy | |
MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYD | |
VQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDEYMBYGA1UE | |
AxMPRXNzZW50aWFsU1NMIENBMB4XDTE0MDQyMjAwMDAwMFoXDTE1MDQyMjIzNTk1 | |
OVowgYwxITAfBgNVBAsTGERvbWFpbiBDb250cm9sIFZhbGlkYXRlZDEuMCwGA1UE | |
CxMlSG9zdGVkIGJ5IEluc3RyYSBDb3Jwb3JhdGlvbiBQdHkuIExURDEeMBwGA1UE | |
CxMVRXNzZW50aWFsU1NMIFdpbGRjYXJkMRcwFQYDVQQDFA4qLm5hcnJhdGl2ZS5p | |
czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK4dCVWXj3/wL+fG68Og | |
buBK42syGaiWoC2OGgGDi9WFp9Gdzxow7NQlhRcKfZjaVGkoLx8EBpBI8LSGWh17 |
# Put this in your init script (Atom ➞ Open Init Script) | |
tabs = atom.workspaceView.find('.tab-bar') | |
tabs.on "DOMNodeInserted", -> | |
# find each tab bar | |
if (tabs.find('li').length) > 1 | |
tabs.slideDown(300) | |
else | |
tabs.slideUp(300) |
Save this as glucky-markdown.rb somewhere...
#!/usr/bin/env ruby
require 'uri'
require 'json'
require 'net/http'
def goog(msg)
def select2_select(option, opts={}) | |
# same as foundation_select, but for select2 | |
# boxes used throughout the staff app. | |
originating_select_name = opts[:from] | |
custom_select = find("select[name='#{originating_select_name}']").parent.find(".select2-container") | |
# click dropdown | |
custom_select.find("a.select2-choice").click | |
# click option with correct text | |
find("ul.select2-results").find('li', text: option).click |
#!/usr/bin/env ruby | |
# Put me in .git/hooks/post-merge | |
# Then do chmod a+x .git/hooks/post-merge | |
migrations = `git diff --name-only master master@{1} | grep db/migrate | wc -l`.strip.to_i | |
if migrations > 0 | |
puts " " | |
puts "**************************************************************" | |
puts "**************************************************************" |
This looks great. |
db2-dfw:/var/www/youversion.com/db/youversiondev# ./migrate | |
Buildfile: /var/www/youversion.com/db/youversiondev/build.xml | |
update-database: | |
[dbdeploy] dbdeploy null | |
[dbdeploy] Reading change scripts from directory /var/www/youversion.com/db/youversiondev/deltas... | |
[dbdeploy] Changes currently applied to database: | |
[dbdeploy] 1..19, 21, 23..27, 29..36, 39 | |
[dbdeploy] Scripts available: | |
[dbdeploy] 1..36, 38..42 |