Skip to content

Instantly share code, notes, and snippets.

impankratov / handlebars.js
Last active September 8, 2021 15:59
Example of registering custom handlebars helpers (+ handlebars-form-helpers) with webpack
View handlebars.js
// Import Handlebars runtime lib
const Handlebars = require('handlebars/runtime');
const register = require('handlebars-form-helpers').register;
const { registerHandlebarHelpers } = require('../../some/other/place');
// Register extra helpers
blowdart / UpdateIISExpressSSLForChome.ps1
Last active October 7, 2021 10:59
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
View UpdateIISExpressSSLForChome.ps1
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
# See
# Run this at an administrative PowerShell prompt.
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
joepie91 /
Last active June 7, 2022 14:43
The Promises FAQ - addressing the most common questions and misconceptions about Promises.
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
View fix-libv8-mac.txt
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
subfuzion /
Last active February 9, 2023 00:44
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

loretoparisi / gist:c147ca437ab9d5e163b7
Created October 23, 2015 22:01
Using JavaScript and k-means to find the dominant colors in images
View gist:c147ca437ab9d5e163b7
<!-- adapted from -->
<script type="text/javascript">
function euclidean(p1, p2) {
var s = 0;
for (var i = 0, l = p1.length; i < l; i++) {
s += Math.pow(p1[i] - p2[i], 2)
remy /
Last active December 9, 2022 16:13
requestAnimationFrame helper


A simple script with a few niceties that allows for multiple requestAnimationFrame calls, and FPS pinning.

How it works

The script polyfills rAF if required, then overloads requestAnimationFrame and cancelAnimationFrame with a process that allows multiple frames to be queued up for rAF to run.

This is useful if there are multiple animations running on the page, you want all the callbacks to happen at once, and not on multiple rAF calls. This script is meant as a drop-in solution to that problem.

nickautomatic /
Last active September 29, 2022 05:38
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
colinbdclark / imperative-adhoc-additive-synthesis.js
Last active August 29, 2015 14:17
Imperative Ad-Hoc Additive Synthesis (Clarinet)
View imperative-adhoc-additive-synthesis.js
var fundamental = 440,
harmonics = [1, 3, 5, 7, 9, 13, 15], // Clarinets only have odd partials.
baseHarmonicDef = {
ugen: "flock.ugen.saw",
freq: 440,
mul: {
ugen: "flock.ugen.envGen",
envelope: {
type: "flock.envelope.adsr",
attack: 0.1,