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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| // Example SSE server in Golang. |
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 'fog' | |
| username = 'testuser' | |
| bucket = 'uniquebucketname1234' | |
| aws_credentials = { | |
| :aws_access_key_id => 'YOUR-ACCESS-KEY-ID', | |
| :aws_secret_access_key => 'YOUR-SECRET-ACCESS-KEY' | |
| } |
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
| class Quantity | |
| include Comparable | |
| CoercedNumber = Struct.new(:value) do | |
| def +(other) raise TypeError; end | |
| def -(other) raise TypeError; end | |
| def *(other) | |
| other * value | |
| end | |
| def /(other) raise TypeError; end |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| // Example SSE server in Golang. |
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
| shared_examples "collections" do | |
| it "is empty when first created" do | |
| expect(described_class.new).to be_empty | |
| end | |
| end | |
| describe Array do | |
| include_examples "collections", Array | |
| end |
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
| class AnonymousUser < User | |
| attr_accessible *ACCESSIBLE_ATTRS, :type, :token, as: :registrant | |
| def register(params) | |
| params = params.merge(type: 'User', token: nil) | |
| self.update_attributes(params, as: :registrant) | |
| end | |
| end |
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
| 'use strict'; | |
| module.exports = function(grunt) { | |
| // load all grunt tasks | |
| require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
| // configurable paths | |
| var paths = { |
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://www.zhubert.com/blog/2013/06/02/activemodel-part-1/ | |
| http://api.rubyonrails.org/classes/ActiveSupport/Autoload.html | |
| http://guides.rubyonrails.org/plugins.html#generate-a-gemified-plugin | |
| or maybe it needs a railitie: | |
| http://api.rubyonrails.org/classes/Rails/Railtie.html |
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
| default: &default | |
| adapter: postgresql | |
| encoding: unicode | |
| pool: 5 | |
| username: root | |
| password: | |
| development: | |
| <<: *default | |
| database: db_development |
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://smsohan.com/blog/2013/05/09/genereating-and-streaming-potentially-large-csv-files-using-ruby-on-rails/ |