Skip to content

Instantly share code, notes, and snippets.

View k-hamada's full-sized avatar
💤
WORK IN PROGRESS

k-hamada k-hamada

💤
WORK IN PROGRESS
View GitHub Profile
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'dry-validation'
end
module Predicates
include Dry::Logic::Predicates
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'dry-validation'
end
schema = Dry::Validation.Schema do
optional(:y).filled(:int?)
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'dry-validation'
end
schema = Dry::Validation.Schema do
optional(:x).filled(:int?)
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'dry-validation'
end
module MyPredicates1
include Dry::Logic::Predicates
"description": "Change fn + letter to left_control + letter",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
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);
[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)
[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
### 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:
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