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
| stripe_id: string | |
| plan_id: integer <= rails | |
| subscription_id: rails <= Lookup on stripe subscription_id | |
| user_id: integer <= rails | |
| credit_card_id: integer <= rails | |
| attempted: boolean | |
| paid: boolean | |
| attempt_count: integer | |
| next_payment: date time <= convert from unix |
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 'execjs' | |
| class JSContextValidator | |
| attr_accessor :answer, :errors | |
| def initialize(context, validation_script, api_call) | |
| @errors = [] | |
| # Load any javascript libraries | |
| js = "" | |
| open(Rails.root.join('app', 'assets', 'javascripts', 'lib', 'underscore.min.js')) { |file| js << file.read } |
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
| { | |
| "pools" : [ | |
| { | |
| "url" : "stratum+tcp://stratum1.shibepool.com:3333", | |
| "user" : "xxxxxxxxxxx", | |
| "pass" : "xxxxxxxxxxx" | |
| } | |
| ] | |
| , | |
| "intensity" : "20,20", |
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
| # Euler more effecient/ruby like answers | |
| # Problem One Examples | |
| sum = 0 | |
| (1..100).each do |int| | |
| sum += int if (int % 3 == 0) || (int % 5 == 0) | |
| end | |
| puts "Sum is: #{sum}" | |
| (1..100).to_a.reduce(0) do |sum, int| | |
| sum += int if (int % 3 == 0) || (int % 5 == 0) |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Ajax</title> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <script> |
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
| # Since this gem is only loaded with the assets group, we have to check to | |
| # see if it's defined before configuring it. | |
| if defined?(AssetSync) | |
| AssetSync.configure do |config| | |
| config.fog_provider = 'AWS' | |
| config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'] | |
| config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] | |
| config.fog_directory = ENV['FOG_DIRECTORY'] | |
| # Fail silently. Useful for environments such as Heroku |
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/ruby | |
| require 'csv' | |
| xml_docs = Dir["./*xml"] | |
| status_counter = xml_docs.count / 10 | |
| status_counter = 1 if status_counter == 0 | |
| outfile = File.open('unique_ids.csv', 'wb') | |
| CSV::Writer.generate(outfile) do |csv| |
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
| [ | |
| { | |
| "kind":"movie", | |
| "title":"Harry Potter and the Sorcerers Stone", | |
| "slug":"harry-potter-and-the-sorcerers-stone", | |
| "image":"http://cdn.hark.com/images/000/589/442/589442/harry-potter-and-the-sorcerer_small.jpg", | |
| "url":"/harry-potter-and-the-sorcerers-stone" | |
| }, | |
| { | |
| "kind":"movie", |
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 'faker' | |
| require 'stringex' | |
| module NodeStubber | |
| def self.included(base) | |
| base.extend ClassMethods | |
| end | |
| module ClassMethods | |
| def stub_defaults |
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
| location = / { | |
| proxy_pass http://clink; | |
| } | |
| location ~* ^/cas/(.*) { | |
| proxy_pass http://clink; | |
| } | |
| location ~* ^/300-the-movie { | |
| proxy_pass http://clink; | |
| } |