Skip to content

Instantly share code, notes, and snippets.

On the way to refactoring

othree othree

On the way to refactoring
View GitHub Profile
othree /
Created Feb 20, 2017
Data on the Web Best Practices
  • Metadata
    • Provide metadata
    • Provide descriptive metadata
    • Provide structural metadata
  • Data Licenses
    • Provide data license information
  • Data Provenance
    • Provide data provenance information
  • Data Quality
    • Provide data quality information


  • expression-oriented programming one of the great advances of FP
  • expressions plug together like legos, making more malleable programming experience in-the-small


Write in an expression-oriented style, scoping variables as locally as possible:

Avaq / combinators.js
Last active Oct 23, 2020
Common combinators in JavaScript
View combinators.js
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
thisconnect / app.js
Last active Jul 14, 2020
rollup split lib and app
View app.js
import * as Lib from 'lib';
console.log(Lib.capitalize('hello world'));
branneman / prototypal-inheritance.js
Last active Jun 2, 2020
ES3 & ES5 — Prototypal Inheritance
View prototypal-inheritance.js
* Parent
function Shape(x, y) {
this.x = x;
this.y = y;
Shape.prototype.constructor = Shape;
Shape.prototype.pos = function() {
return [this.x, this.y];
paulirish /
Last active Oct 30, 2020
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
ImJasonH / markdown.css
Last active Oct 19, 2020
Render Markdown as unrendered Markdown (see
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
drobune / gist:e03d64ef7ba02864781a
Created Dec 12, 2014
get only status code on curl
View gist:e03d64ef7ba02864781a
curl -LI -o /dev/null -w '%{http_code}\n' -s

Disclaimer: This is an unofficial post by a random person from the community. I am not an official representative of io.js. Want to ask a question? open an issue on the node-forward discussions repo

io.js - what you need to know


  • io is a fork of node v0.12 (the next stable version of node.js, currently unreleased)
  • io.js will be totally compatible with node.js
  • the people who created io.js are node core contributors who have different ideas on how to run the project
  • it is not a zero-sum game. many core contributors will help maintain both node.js and io.js
View Pandoc in a CentOS 6 Docker

Give me back my sanity

One of the many things I do for my group at work is to take care of automating as many things as possible. It usually brings me a lot of satisfaction, mostly because I get a kick out of making people's lives easier.

But sometimes, maybe too often, I end up in drawn-out struggles with machines and programs. And sometimes, these struggles bring me to the edge of despair, so much so that I regularly consider living on a computer-less island growing vegetables for a living.

This is the story of how I had to install Pandoc in a CentOS 6 Docker container. But more generally, this is the story of how I think computing is inherently broken, how programmers (myself included) tend to think that their way is the way, how we're ultimately replicating what most of us think is wrong with society, building upon layers and layers of (best-case scenario) obscure and/or weak foundations.

*I would like to extend my gratitude to Google, StackOverflow, GitHub issues but mostly, the people who make the

You can’t perform that action at this time.