Skip to content

Instantly share code, notes, and snippets.


Safi myuseringithub

View GitHub Profile
borekb /
Last active Nov 28, 2020
Docker and Git Bash / MSYS2 on Windows: path conversion workaround

👋 Moved to

Docker in Git Bash / MSYS2 on Windows: path conversion workaround

UPDATE 07/2018: I switched from Git Bash to MSYS2 recently which should be very similar, if not the same, but there some subtle differences which made me realize this is more tricky than I thought and that I don't 100% understand what is going on. If someone can help, please let me know in the comments.

Invoking docker in MSYS2 shell or Git Bash typically fails with complains about paths, for example:

zhirzh / multiple-inheritance.js
Created Feb 8, 2018
Multiple Inheritance in JS
View multiple-inheritance.js
function inheritsObject(baseObject, superObject) {
Object.setPrototypeOf(baseObject, superObject);
function inheritsMultipleObjects(baseObject, superObjects) {
new Proxy({}, {
get(target, key, rec) {
tpae / graph.js
Last active Oct 20, 2020
JavaScript implementation of Graph Data Structure
View graph.js
// Implement a Graph
// basic operations:
// - add vertex (node)
// - add edge (node -> node)
function GraphNode(val) {
this.val = val;
this.edges = {};
parmentf /
Last active Jan 20, 2021
Git Commit message Emoji
jamestalmage /
Last active Nov 29, 2020
Breakdown of How Require Extensions Work


Doing require extensions correctly is essential, because:

  1. Users should be able to install multiple extensions in succession, and have them work together.
  2. Coverage tools like nyc need it to reliably supply coverage information that takes into account sourcemaps from upstream transforms.
  3. Because non-standard, un-predictable behavior causes hard to solve bugs, and major headaches for project maintainers.

What is a require extension anyways?

CMCDragonkai /
Last active Jan 13, 2021
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

View gist:4fa3c4228a8bb53cc71d
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
tantaman / polymer-requirejs
Last active Apr 5, 2018
polymer + requirejs : originally by Scott Miles from:
View polymer-requirejs
<!doctype html>
<title>Polymer and RequireJS</title>
<script src=""></script>
<!-- #foo -->
<div id="foo">the foo has no joy.</div>
webdesserts / Gulpfile.js
Last active Dec 9, 2020
Automatically reload your node.js app on file change with Gulp (
View Gulpfile.js
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
shinout / LICENSE
Created Sep 21, 2011
Topological sort in JavaScript
Copyright 2012 Shin Suzuki<>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
You can’t perform that action at this time.