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 'irb' | |
module IRB | |
WAITING_FOR_INPUT_IDENTIFIER = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
class MyInputMethod < StdioInputMethod | |
def gets | |
puts WAITING_FOR_INPUT_IDENTIFIER | |
print @prompt + "\n" | |
line = @stdin.gets |
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
module React | |
def self.create_element(klass) | |
%x{ | |
function ctor(){ | |
this.constructor = ctor | |
React.Component.apply(this, arguments); | |
klass._alloc.prototype.$initialize.call(this); | |
}; | |
ctor.prototype = klass._proto; | |
Object.assign(ctor.prototype, React.Component.prototype); |
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
From 22a8d63c748a3abf1dc0dd619d4d3b0d3f848c5c Mon Sep 17 00:00:00 2001 | |
From: David Chang <[email protected]> | |
Date: Fri, 30 Sep 2016 17:50:12 +0800 | |
Subject: [PATCH] Some fix | |
--- | |
application.rb | 7 ++++--- | |
controller.rb | 4 +++- | |
2 files changed, 7 insertions(+), 4 deletions(-) |
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
class Hash | |
def destruct(&block) | |
keys = block.parameters.map{|a| a[1]} | |
block.call(*self.values_at(*keys)) | |
end | |
end | |
h = { a: 10, foo: 'bar', c: true } | |
h.destruct { |foo, a| |
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
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
OlderNewer