| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| import code; code.interact(local=dict(globals(), **locals())) |
| 'use strict'; | |
| var babel = require('babel-core'); | |
| var fs = require('fs'); | |
| // borrowed from https://github.com/babel/babel-jest/blob/master/index.js | |
| require.extensions['.jsx'] = function (module, filename) { | |
| var src = fs.readFileSync(filename, 'utf8'); | |
| // Allow the stage to be configured by an environment | |
| // variable, but use Babel's default stage (2) if |
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
| { | |
| "binary_file_patterns": | |
| [ | |
| "*.tga", | |
| "*.dds", | |
| "*.ico", | |
| "*.eot", | |
| "*.pdf", | |
| "*.psd", | |
| "*.swf", |
| /* | |
| ##Device = Desktops | |
| ##Screen = 1281px to higher resolution desktops | |
| */ | |
| @media (min-width: 1281px) { | |
| /* CSS */ | |
Now published as @root/uuid
- Node version: https://github.com/therootcompany/uuid.js/blob/main/uuid.js
- Browser version: https://github.com/therootcompany/uuid.js/blob/main/browser.js
This is started out as a curiosity, pasted as a gist but now, years later, I've come back to it because there are too many of these uuid modules out there and they're too complicated.
This, however, is easy to read and understand (for me, at least). Even its tests are dependncy and build-step free.
node-uuid vs crazy-uuid vs fast-uuid
| function logClass(target: any) { | |
| // save a reference to the original constructor | |
| var original = target; | |
| // a utility function to generate instances of a class | |
| function construct(constructor, args) { | |
| var c : any = function () { | |
| return constructor.apply(this, args); | |
| } |
| #!/usr/bin/env bash | |
| sudo yum groups install -y Development\ tools | |
| sudo yum install -y cmake | |
| sudo yum install -y python34-{devel,pip} | |
| sudo pip-3.4 install neovim --upgrade | |
| ( | |
| cd "$(mktemp -d)" | |
| git clone https://github.com/neovim/neovim.git | |
| cd neovim | |
| make CMAKE_BUILD_TYPE=Release |