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 | |
########################################## | |
# | |
# This script is to help you get around the dreaded 'Resource Has A Dependent Object' | |
# when deleting something in AWS. It will search a handful of places for that sg ID | |
# and let you know if it finds anything. Its a pretty quick n dirty script. | |
# | |
# If I missed any areas it should search, please let me know or better yet, make a pull request! | |
# | |
# You'll need to install the aws-sdk ruby gem: sudo gem install aws-sdk |
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
require 'net/http' | |
class Nutritionix | |
def initialize(app, key) | |
@app = app | |
@key = key | |
@url = URI.parse('https://api.nutritionix.com/v1_1/search') | |
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
tickets = {83=>"@_mcarroll_", 9=>"@nygeog", 750=>"@binbrain", 267=>"@sanjivslall", 899=>"@kendeveloper", 99=>"@SkiNatasha", 396=>"@ElFuturero", 600=>"@shahakash", 526=>"@sarahjukes", 512=>"@chasballew", 626=>"@fancyremarker", 4=>"@johnpaulett", 131=>"@shawn_oakley", 19=>"@mackenco", 482=>"@_clapaz"} | |
winner = nil | |
nojoys = [] | |
while winner.nil? do | |
number = rand(1..1000) | |
tickets.include?(number) ? winner = tickets[number] : nojoys << number | |
end | |
p nojoys | |
puts "After #{nojoys.count} draws, the winner is: #{winner}!" |
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
tickets = {83=>"@_mcarroll_"} | |
winner = nil | |
nojoys = [] | |
while winner.nil? do | |
number = rand(1..1000) | |
tickets.include?(number) ? winner = tickets[number] : nojoys << number | |
end | |
p nojoys | |
puts "After #{nojoys.count} draws, the winner is: #{winner}!" |
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
desc "Normalize Uzbek file." | |
task :uzbek => :environment do | |
require 'csv' | |
counter = 0 | |
entry_counter = 0 | |
previous = nil | |
desc_array = [] | |
new_file = File.open("/Users/woodchip/fixed_UE.txt", 'w') |
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
require 'aws' | |
class Rake::Task | |
def replace &block | |
@actions.clear | |
prerequisites.clear | |
enhance &block | |
end | |
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
camanCache = {} | |
imageValues = {} | |
$('.blimage, .largedisplay').each (-> | |
imgName = $(@).attr('id') | |
loc = $(@).html() | |
camanCache[imgName] = Caman(loc, "##{imgName}") | |
$(@).css('height', '') | |
imageValues[imgName] = {} | |
) |