This file contains hidden or 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 | |
| require 'rubygems' | |
| require 'mechanize' | |
| URL_PRELOADER = 'https://customer.comcast.com/Secure/Preload.aspx?backTo=%2fSecure%2fUsers.aspx&preload=true' | |
| URL_USERS = 'https://customer.comcast.com/Secure/Users.aspx' | |
| abort "Usage: #{$0} <username> <password>" unless ARGV.length == 2 |
This file contains hidden or 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
| http = require 'http' | |
| rest = require 'restler' | |
| realm = escape "Staghelm" | |
| guild = escape "Controlled Chaos" | |
| type = { | |
| 1: "Warrior", 2: "Paladin", 3: "Hunter", | |
| 4: "Rogue", 5: "Priest", 6: "Death Knight", | |
| 7: "Shaman", 8: "Mage", 9: "Warlock", |
This file contains hidden or 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 File.expand_path(File.dirname(__FILE__) + '/../samples_config') | |
| # Topic's arn can be found in AWS Management, under Topic Details. | |
| (topic_arn, message) = ARGV | |
| unless topic_arn && message | |
| puts "Usage: upload.rb <TOPIC_ARN> <MESSAGE>" | |
| exit 1 | |
| end | |
| # Get an instance of the SNS interface using the default configuration |
This file contains hidden or 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 'rubygems' | |
| require 'bcrypt' | |
| require 'haml' | |
| require 'sinatra' | |
| enable :sessions | |
| userTable = {} | |
| helpers do |
This file contains hidden or 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 "rubygems" | |
| require "haml" | |
| require "sinatra" | |
| require "linkedin" | |
| enable :sessions | |
| helpers do | |
| def login? | |
| if session[:atoken].nil? |
This file contains hidden or 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 'rubygems' | |
| require 'nestful' | |
| require 'mongo' | |
| db = Mongo::Connection.new.db("wowstats") | |
| coll = db.collection("character") | |
| coll.drop | |
| type = { | |
| 1 => "Warrior", 2 => "Paladin", 3 => "Hunter", |
This file contains hidden or 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 'rubygems' | |
| require 'open-uri' | |
| require 'yajl' | |
| require 'redis' | |
| realm = "Lothar" | |
| filePath = Yajl::Parser.parse(open("http://us.battle.net/api/wow/auction/data/#{realm}"))["files"].first['url'] | |
| puts filePath | |
| redis = Redis.new |
This file contains hidden or 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 "rubygems" | |
| require "sinatra" | |
| require "haml" | |
| require "mongo_mapper" | |
| class Shorten | |
| include MongoMapper::Document | |
| key :url, String | |
| key :shorten_id, String |
This file contains hidden or 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
| crypto = require('crypto'); | |
| #Quick MD5 of text | |
| text = "MD5 this text!" | |
| md5hash1 = crypto.createHash('md5').update(text).digest("hex") | |
| #MD5 of text with updates | |
| m = crypto.createHash('md5') | |
| m.update("MD5 ") | |
| m.update("this ") |
This file contains hidden or 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
| aws = require ('aws-lib') | |
| access_key_id = "<Your access key id>" | |
| secret_access_key = "<Your secret access key>" | |
| options = { | |
| "path" : "<Your queue URL, just the /accountid/queue_name is needed>" | |
| } | |
| sqs = aws.createSQSClient(access_key_id, secret_access_key, options) |
OlderNewer