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 ( | |
| "time" | |
| "entities" | |
| ) | |
| func main() { | |
| d := time.Date(2008, time.November, 10, 23, 0, 0, 0, time.UTC) | |
| entities.ageFromNow(d) // compiling error |
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" | |
| func main() { | |
| fmt.Println("Hello 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 'rails_helper' | |
| RSpec.configure do |config| | |
| config.before(:each, type: :feature) do | |
| fixture_path = "#{Rails.root}/spec/fixtures" | |
| fixtures = Dir["#{fixture_path}/**/*.yml"].map { |f| File.basename(f, '.yml') } | |
| ActiveRecord::FixtureSet.create_fixtures(fixture_path, fixtures) | |
| 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
| files = Dir.glob("app/**/*.rb") | |
| files.concat Dir.glob("lib/**/*.rb") | |
| files.each do |file_name| | |
| lines = File.readlines(file_name) | |
| if !["#encoding: utf-8\n", "# encoding: utf-8\n"].include?(lines.first) | |
| puts "Rewriting #{file_name}" | |
| lines = ["#encoding: utf-8\n"].concat lines | |
| new_file = File.new(file_name, "w") | |
| lines.each { |line| new_file.write line } |
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 Numeric | |
| def £(other_number) | |
| RepeatingDecimal.new(self, other_number) | |
| end | |
| end | |
| class RepeatingDecimal | |
| attr_reader :repeating | |
| def initialize(base, repeating) |
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
| oftWrap = true | |
| tabSize = 2 | |
| softTabs = true |
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
| bundle | |
| Unfortunately, a fatal error has occurred. Please see the Bundler | |
| troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! | |
| /Users/felix/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server key exchange B: bad ecpoint (OpenSSL::SSL::SSLError) | |
| from /Users/felix/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:917:in `block in connect' | |
| from /Users/felix/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/timeout.rb:51:in `timeout' | |
| from /Users/felix/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:917:in `connect' | |
| from /Users/felix/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:861:in `do_start' | |
| from /Users/felix/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http.rb:856:in `start' | |
| from /Users/felix/.rvm/gems/ruby-2.0.0-p0@oeconomicae/gems/bundler-1.3.0/lib/bundler/vendor/net/http/persistent.rb:628:in `start' |
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
| Collection.extend({ | |
| byId: function () { | |
| this.filter(function (n) { | |
| console.log(n); | |
| return n; | |
| }); | |
| } | |
| }) |
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 TvShow | |
| def initialize | |
| yield self if block_given? | |
| end | |
| def self.add(&block) | |
| tv_show = TvShow.new(&block) | |
| @@shows ||= [] | |
| @@shows << tv_show | |
| 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
| errorHandler: function (model, response) { | |
| var result = $.parseJSON(response.responseText); | |
| _(result.errors).each(function (errors, attribute) { | |
| var inputWithError = $('#'+attribute), | |
| parentDiv = inputWithError.parent(); | |
| parentDiv.addClass('error'); | |
| _(errors).each(function (error) { | |
| $("<span class='help-inline'></span>"). |
NewerOlder