Skip to content

Instantly share code, notes, and snippets.

@PsixokoT
PsixokoT / injectIntl.ts
Created December 20, 2018 10:02
How convert to ts
interface InjectedIntlProps {
intl: InjectedIntl;
}
interface InjectIntlConfig {
intlPropName?: string;
withRef?: boolean;
}
function injectIntl<P>(component: React.ComponentType<P & InjectedIntlProps>, options?: InjectIntlConfig):
@PsixokoT
PsixokoT / self_private.rb
Created April 16, 2018 21:04
why self private method different private setter
class Example
def initialize(name)
@name = name
end
def test_equal_private(ex)
self.private_property == ex.private_property
end
def test_equal_protected(ex)
@PsixokoT
PsixokoT / loop_1.rb
Last active January 31, 2017 11:51
native loop vs. ruby loop
def ruby_loop
yield while true
end
def native_loop_test
time = Time.now
n = 0
loop do
n = n + 1
break if Time.now - time > 5