Skip to content

Instantly share code, notes, and snippets.

Hi Akira!
import './Foo.scss'
export default class Foo extends React.Component {
render() {
const { someProp } = this.props
return (
<div className="Foo">
...
</div>

Keybase proof

I hereby claim:

  • I am zuk on github.
  • I am zuk (https://keybase.io/zuk) on keybase.
  • I have a public key ASBcP-PkF8fSEym3UrGtc3noRG-AH3dFlKDPCcReah2Gzwo

To claim this, I am signing this object:

@zuk
zuk / chainable_proto_promise.js
Last active August 4, 2018 18:00
Proto-Proimse
function Promise() { };
Promise.prototype = {
then: function(cb) {
var p = new Promise();
this.resolve = function(v) {
var value = cb(v);
if (p.resolve) p.resolve(value);
};
return p;
}
@zuk
zuk / redux_denormalizr.js
Last active February 3, 2016 10:09
Denormalizr
// copied from https://github.com/dotcs/normalizr/blob/963f9297ef5c97866bc3e6de5cdef730155a3e09/src/index.js
// ... waiting until this gets merged into normalizr
// see https://github.com/gaearon/normalizr/pull/20
import isObject from 'lodash/lang/isObject'
import clone from 'lodash/lang/clone'
import { Schema as EntitySchema } from 'normalizr'
function visitObjectForDenorm(obj, schema, bag) {
var denormalized = {},
@zuk
zuk / ruby_warrior_beginner.rb
Last active August 29, 2015 14:19
Ruby Warrior (Beginner)
class Player
DIRS = [:forward, :backward]
def initialize
@dir = :forward
end
def play_turn(warrior)
@warrior = warrior
@zuk
zuk / compass.js
Last active August 29, 2015 13:56
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
@zuk
zuk / pm2
Created February 6, 2014 20:51
/etc/init.d/pm2 for CentOS
#!/bin/bash
# chkconfig: 2345 98 02
#
# description: PM2 next gen process manager for Node.js
# processname: pm2
#
### BEGIN INIT INFO
# Provides: pm2
# Required-Start:
# Required-Stop:
@zuk
zuk / vim_quickies
Created November 27, 2013 17:40
vim quickies
# re-run last command with sudo/root
:w !sudo tee %
@zuk
zuk / aborted_http_request.sh
Created June 6, 2013 16:51
Send aborted HTTP request for testing handling of broken requests
curl http://127.0.0.1:8080/ &
P=$!
sleep 0.008 && kill -9 $P