Skip to content

Instantly share code, notes, and snippets.

diff --git a/.gitignore b/.gitignore
index 82701fe..9b10e17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,19 +1,8 @@
-# See https://help.github.com/articles/ignoring-files for more about ignoring files.
-#
-# If you find yourself ignoring temporary files generated by your text editor
-# or operating system, you probably want to add a global ignore instead:
-# git config --global core.excludesfile '~/.gitignore_global'
diff --git a/.gitignore b/.gitignore
index 48fb168..16ffc48 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,6 @@
-# See https://help.github.com/articles/ignoring-files for more about ignoring files.
-#
-# If you find yourself ignoring temporary files generated by your text editor
-# or operating system, you probably want to add a global ignore instead:
-# git config --global core.excludesfile '~/.gitignore_global'
import Html exposing (..)
-- MODEL
type alias Model =
{}
-- UPDATE
import Html exposing (..)
-- MODEL
type alias Model =
{}
-- UPDATE
@dskecse
dskecse / regexen.rb
Created August 15, 2016 09:40
ruby 2.3.1
require 'benchmark'
n = 5_000_000
Benchmark.bmbm do |x|
x.report('String#match') do
n.times do
'metadata:foo=bar'.match(/metadata:/)
end
end
@dskecse
dskecse / clone_vs_dup.rb
Created June 6, 2016 15:02
see how #clone copies singleton methods
irb(main):001:0> str = 'This is my STRING!'
=> "This is my STRING!"
irb(main):002:0> def str.-@
irb(main):003:1* downcase
irb(main):004:1> end
=> :-@
irb(main):005:0> p str
"This is my STRING!"
=> "This is my STRING!"
irb(main):006:0> p -str
@dskecse
dskecse / Enhance.js
Last active May 28, 2016 12:46 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export const Enhance = ComposedComponent => class extends Component {
constructor() {
super()
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
@dskecse
dskecse / propTypesFailure.js
Created May 21, 2016 15:45
make your tests fail on any propTypes errors
beforeAll(() => {
console.error = error => (
throw new Error(error);
);
});
diff --git a/src/components/Article.js b/src/components/Article.js
new file mode 100644
index 0000000..fef5d8a
--- /dev/null
+++ b/src/components/Article.js
@@ -0,0 +1,55 @@
+import React, { PropTypes, Component } from 'react'
+
+// stateful component (w/ state)
+class Article extends Component {
@dskecse
dskecse / sample.js
Created May 19, 2016 14:49
es.next single-argument class method
class User {
// ...
handleChange = e => {
}
}