This file contains 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 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'dry-validation' | |
end | |
module Predicates | |
include Dry::Logic::Predicates |
This file contains 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 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'dry-validation' | |
end | |
schema = Dry::Validation.Schema do | |
optional(:y).filled(:int?) |
This file contains 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 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'dry-validation' | |
end | |
schema = Dry::Validation.Schema do | |
optional(:x).filled(:int?) |
This file contains 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 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'dry-validation' | |
end | |
module MyPredicates1 | |
include Dry::Logic::Predicates |
This file contains 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
"description": "Change fn + letter to left_control + letter", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "tab", | |
"modifiers": { | |
"mandatory": [ | |
"fn" | |
], | |
"optional": [ |
This file contains 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 xpi/chrome/content/library/utility.js xpi/chrome/content/library/utility.js | |
index 180c382..9520b19 100755 | |
--- xpi/chrome/content/library/utility.js | |
+++ xpi/chrome/content/library/utility.js | |
@@ -872,7 +872,7 @@ function simpleRequest(url, opt) { | |
if (file instanceof IFile) { | |
// https://developer.mozilla.org/en-US/docs/Extensions/Using_the_DOM_File_API_in_chrome_code | |
- file = sendContent[key] = new File(file); | |
+ file = sendContent[key] = File.createFromNsIFile(file); |
This file contains 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
[1] pry(main)> class MyHash < Hash | |
[1] pry(main)* include Hashie::Extensions::MergeInitializer | |
[1] pry(main)* include Hashie::Extensions::IndifferentAccess | |
[1] pry(main)* end | |
=> MyHash | |
[2] pry(main)> h={a: {b: 1}} | |
=> {:a=>{:b=>1}} | |
[3] pry(main)> h | |
=> {:a=>{:b=>1}} | |
[4] pry(main)> MyHash.new(h) |
This file contains 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
[1] pry(main)> require "date" | |
=> true | |
[2] pry(main)> (Date.today .. Date::Infinity.new).cover? Date.parse("2112/9/3") | |
=> true | |
[3] pry(main)> (-Date::Infinity.new .. Date::Infinity.new).cover? Date.parse("2112/9/3") | |
=> false | |
[4] pry(main)> (0 .. Float::INFINITY).cover? 1 | |
=> true | |
[5] pry(main)> (-Float::INFINITY .. Float::INFINITY).cover? 1 | |
=> true |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am k-hamada on github. | |
* I am khamada (https://keybase.io/khamada) on keybase. | |
* I have a public key whose fingerprint is 85F0 3A07 796C E119 3D15 63AF 7F5C 93E8 D8CB 9448 | |
To claim this, I am signing this object: |
This file contains 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 "active_record" | |
class Mother < ActiveRecord::Base | |
def self.inherited(subclass) | |
puts "Base Class: #{self}" | |
puts "New subclass: #{subclass}" | |
end | |
end | |
class Taro < Mother | |
end |
NewerOlder