Skip to content

Instantly share code, notes, and snippets.

Working hard

Gilbert gilbert

Working hard
Block or report user

Report or block gilbert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gilbert / showcase.jsx
Created Feb 12, 2018
JSX Formatting Tips
View showcase.jsx
class Showcase extends React.Component {
constructor(props) {
this.state = { ... }
toggle() {
this.setState({ open: ! })
render() {
var {open, loading} = this.state
gilbert / DefaultKeyBinding.dict
Last active Feb 27, 2018
Add missing keyboard shortcuts on OS X
View DefaultKeyBinding.dict
Create this as a file ~/Library/KeyBindings/DefaultKeyBinding.dict
Then restart your computer.
NOTE: ~ means alt/option
^ means ctrl
gilbert / data-deps.js
Last active Feb 7, 2018
React GET Data Dependencies helper
View data-deps.js
// Our main data fetching tool.
// This fetches an object of promise makers ONLY ON THE CLIENT SIDE,
// and manages loading and data states for each key.
import React from 'react'
import http from './http'
export default (promisesMakers, options={}) => Component =>
class FetchHOC extends React.Component {
gilbert / actual.js
Last active Sep 29, 2017
Pipeline op code
View actual.js
var inc = (x) => x + 1;
var double = (x) => x * 2;
var x = 10 |> inc |> double;
var y = 10 |> inc;
gilbert / logs.txt
Created Jun 5, 2017
Reason build error logs
View logs.txt
Configuring for host x86_64-apple-darwin16.6.0 ...
Configuring for target x86_64-apple-darwin16.6.0 ...
Using compiler gcc.
The C compiler is ANSI-compliant.
Checking the sizes of integers and pointers...
Wow! A 64 bit architecture!
This is a little-endian architecture.
Doubles can be word-aligned.
64-bit integers can be word-aligned.
Native division and modulus have round-towards-zero semantics, will use them.
gilbert / index.html
Created Mar 7, 2017
Minimal Mithril 1.0 boilerplate
View index.html
<!doctype html><title>Minimal Mithril</title>
<div id="app"></div>
<script src=""></script>
var AppComponent = {
view: function (vnode) {
return m('h1', "Hello World!")
gilbert / DefaultKeyBinding.dict
Created Feb 17, 2017
Enable terminal text navigation keyboard shortcuts across entire OS X operating system
View DefaultKeyBinding.dict
/* Create a new file at ~/Library/KeyBindings/DefaultKeyBinding.dict */
/* and copy/paste this into it. */

Keybase proof

I hereby claim:

  • I am gilbert on github.
  • I am mindeavor ( on keybase.
  • I have a public key whose fingerprint is 7DB8 DF5F 0720 815C 104C 416A F8BA C5DA 9D8C 1B56

To claim this, I am signing this object:

gilbert / definition.js
Last active Aug 5, 2016
Expand / Collapse Animation with Mithril v1.x
View definition.js
var animateHeight = {
oncreate: function (vnode) {
var height = vnode.dom.clientHeight = 0
vnode.dom.offsetHeight // Trick to recalc layout
window.requestAnimationFrame( ()=> ( = height+1+"px") )
onbeforeremove: function (vnode, done) {
vnode.dom.addEventListener('transitionend', done) = 0
gilbert / example.html
Created Jun 7, 2016
JavaScript DOM: Render line numbers on pre with no dependencies
View example.html
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="line-numbers.css">
<pre><code>function add (a, b) {
return a + b;
You can’t perform that action at this time.