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
| val swipe = List( | |
| DownEvent(Seq(Vector2(0, 0))), | |
| MoveEvent(Seq(Vector2(10, 5))), | |
| MoveEvent(Seq(Vector2(15, 10))), | |
| MoveEvent(Seq(Vector2(0, 0))), | |
| UpEvent(Seq(Vector2(10, 5))) | |
| ) | |
| val events = PublishSubject[MotionEvent] |
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
| @main = -> | |
| canvas = document.getElementsByTagName("canvas")[0] | |
| gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl") | |
| compiler = new WebGLCompiler(gl, window.shaders) | |
| program = compiler.createProgramWithShaders("main_vertex", "main_fragment") | |
| gl.clearColor(1.0, 1.0, 1.0, 1.0) | |
| gl.clear(gl.COLOR_BUFFER_BIT) | |
| gl.useProgram(program) |
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 WebGLCompiler | |
| constructor: (@gl, @shaders) -> | |
| createProgramWithShaders: (vertexShaderName, fragmentShaderName) -> | |
| vertexShader = @_createShader(vertexShaderName) | |
| fragmentShader = @_createShader(fragmentShaderName) | |
| @_createProgram(vertexShader, fragmentShader) | |
| _createShader: (shaderName) -> | |
| shaderSource = @shaders["#{shaderName}.glsl"] |
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
| $x = null; | |
| $x[0] = 1; | |
| echo var_dump($x); | |
| /* | |
| array(1) { | |
| [0]=> | |
| int(1) | |
| } | |
| */ |
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
| ENV['BUNDLE_GEMFILE'] = File.expand_path('../../rails/Gemfile', __FILE__) | |
| require_relative '../rails/load_paths' | |
| require 'active_record' | |
| require 'active_support/all' | |
| require 'minitest/autorun' | |
| ActiveRecord::Base.establish_connection(adapter: :sqlite3, database: ":memory:") | |
| ActiveRecord::Base.logger = Logger.new(STDOUT) | |
| ActiveRecord::Schema.define 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
| class User < ActiveRecord::Base | |
| has_many :posts | |
| end | |
| class Post < ActiveRecord::Base | |
| belongs_to :user, counter_cache: true | |
| end | |
| user = User.create | |
| user.posts_count # => 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
| require_relative '../load_paths' | |
| require 'active_record' | |
| require 'active_support/all' | |
| Time.zone = ActiveSupport::TimeZone['Central Time (US & Canada)'] | |
| ActiveRecord::Base.time_zone_aware_attributes = true | |
| ActiveRecord::Base.establish_connection(adapter: :sqlite3, database: ':memory:') | |
| class MyModel < ActiveRecord::Base |
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
| diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb | |
| index 53a9c87..cec50f6 100644 | |
| --- a/activerecord/lib/active_record/attribute_methods/serialization.rb | |
| +++ b/activerecord/lib/active_record/attribute_methods/serialization.rb | |
| @@ -50,150 +50,21 @@ module ActiveRecord | |
| # serialize :preferences, Hash | |
| # end | |
| def serialize(attr_name, class_name_or_coder = Object) | |
| - include Behavior | |
| - |
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_relative '../load_paths' | |
| require 'active_record' | |
| ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
| class Book < ActiveRecord::Base | |
| has_and_belongs_to_many :genres | |
| has_many :genre_memberships | |
| has_many :genres2, through: :genre_memberships, source: :genre | |
| 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
| diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb | |
| index f2fbd5a..5e4e00b 100644 | |
| --- a/activerecord/lib/active_record/connection_adapters/column.rb | |
| +++ b/activerecord/lib/active_record/connection_adapters/column.rb | |
| @@ -13,101 +13,36 @@ module ActiveRecord | |
| ISO_DATETIME = /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z/ | |
| end | |
| - attr_reader :name, :default, :type, :limit, :null, :sql_type, :precision, :scale, :default_function | |
| - attr_accessor :primary, :coder |