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
| List<Product> products; | |
| products = (from item in xdoc.Descendants("object") | |
| select new Product() | |
| { | |
| Name = item.Element("name").Value, | |
| Description = item.Element("description").Value | |
| }).ToList(); |
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
| <objects type="array"> | |
| <object> | |
| <id type="integer">1</id> | |
| <name>Śmietanka łaciata</name> | |
| <description nil="true"/> | |
| <company-name>Mlekpol</company-name> | |
| <ingredients type="array"> | |
| <ingredient> | |
| <id type="integer">1</id> | |
| <number>E339</number> |
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 YmlLength | |
| attr_accessor :data, :result | |
| def initialize(path) | |
| self.data = YAML::load_file(Rails.root.join(path)).to_a.flatten.last | |
| self.result = "" | |
| get_value(data) | |
| 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
| . |
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 ActionDispatch::Session::JsonSerializer | |
| def self.load(value) | |
| JSON.load(value) + " and loaded" | |
| end | |
| def self.dump(value) | |
| JSON.dump(value + " was dumped") | |
| 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
| @db = '' | |
| @user = '' | |
| @password = '' | |
| unless File.exist?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'arel', github: 'rails/arel' | |
| gem 'pg' |
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
| unless File.exist?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'arel', github: 'rails/arel' | |
| gem 'sqlite3' | |
| GEMFILE | |
| system 'bundle' | |
| 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
| 4 8 | |
| -2 -2 -3 1 | |
| 3 0 1 3 | |
| 1 3 -3 3 | |
| 2 0 0 -2 | |
| 0 0 2 1 | |
| 2 2 2 3 | |
| 1 2 1 3 | |
| 3 2 3 3 | |
| 3 0 3 3 |
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 Maclaurin | |
| attr_reader :x, :steps, :function | |
| DERIVATIVE = { | |
| "sin" => "cos", | |
| "cos" => "-sin", | |
| "-sin" => "-cos", | |
| "-cos" => "sin", | |
| "e" => "e" |
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
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "rails", github: "rails/rails" |
OlderNewer