Skip to content

Instantly share code, notes, and snippets.

Avatar

Chase Colman chase

  • Taipei, Taiwan
View GitHub Profile
View CombinatoricsUtil.js
'use strict';
// Authored 2018-10-26 Chase Colman
var Util = (function() {
/**
* combinate visitor callback
* @callback Util~combinateCallback
* @param {[]} combination - currently visited combination
* @return {boolean} - terminates combinate if true
*/
View gist:cc980da37005dc0d48bed7b3cdd9f4d5
FAIL src/renderers/shared/fiber/__tests__/ReactTopLevelFragment-test.js
● ReactTopLevelFragment › should render a simple fragment at the top of a component
ReferenceError: shouldTrackSideEffects is not defined
at deleteRemainingChildren (src/renderers/shared/fiber/ReactChildFiber.js:76:8)
at reconcileChildFibers (src/renderers/shared/fiber/ReactChildFiber.js:767:12)
at reconcileChildrenAtPriority (src/renderers/shared/fiber/ReactFiberBeginWork.js:83:30)
at reconcileChildren (src/renderers/shared/fiber/ReactFiberBeginWork.js:71:5)
at updateHostComponent (src/renderers/shared/fiber/ReactFiberBeginWork.js:285:7)
@chase
chase / nginx-custom-build.sh
Created Mar 25, 2016 — forked from a-rodin/nginx-custom-build.sh
Build Ubuntu or Debian packages for nginx with custom patches, configs, and name suffixes in one command
View nginx-custom-build.sh
#!/bin/bash
# Author: Alexander Rodin <rodin.alexander@gmail.com>
# License: MIT
BUILD_DIR=build
while getopts "hp:s:r:b:o:c:n" opt; do
case $opt in
h)
echo "Usage: $0 [options]"
@chase
chase / .eslintrc
Created Sep 5, 2015
Import Plugin Breaking on Spread
View .eslintrc
{
"parser": "babel-eslint",
"plugins": [
"react",
"import"
],
"env": {
"browser": true,
"node": true
},
@chase
chase / .eslintrc
Created Jul 19, 2015
Import errors
View .eslintrc
{
"plugins": ["import"],
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"env": {
"browser": true,
"node": true,
"es6": true
@chase
chase / fix-pkm.sh
Last active Aug 29, 2015
Fix Mono KPM on Linux (Add MS Certs)
View fix-pkm.sh
# kpm restore whines about failing to write some headers, here's the non-obvious fix:
# Add Microsofts poorly signed certificates!
sudo certmgr -ssl -m https://go.microsoft.com
sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net
sudo certmgr -ssl -m https://nuget.org
mozroots --import --sync
View fixtrackpad@.service
[Unit]
Description=Fix trackpad after resume
After=suspend.target
After=hibernate.target
[Service]
User=%I
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/bin/xinput -enable bcm5974
@chase
chase / ansible.snippets
Last active Aug 29, 2015
snippet_gen generated Snipmate file for ansible
View ansible.snippets
snippet rollbar_deployment
rollbar_deployment:
environment: ${1:# REQUIRED}
token: ${2:# REQUIRED}
revision: ${3:# REQUIRED}
comment: ${4}
rollbar_user: ${5}
url: ${6:https://api.rollbar.com/api/1/deploy/}
user: ${7}
validate_certs: ${8:#yes|no}
View .ctags
--langdef=moonscript
--langmap=moonscript:.moon
--regex-moonscript=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/
--regex-moonscript=/^[ \t]*@?(([A-Za-z][A-Za-z0-9_.]*)+):.*[-=]>.*$/\1/m,method/
--regex-moonscript=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=.*[-=]>.*$/\1/f,function/
--regex-moonscript=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/v,variable/
--regex-moonscript=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/p,property/
--regex-moonscript=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/s,static property/
--regex-moonscript=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/p,property/
--regex-moonscript=/(new:[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/p,property/
@chase
chase / uuidv5-email.js
Created Jul 28, 2014
UUID v5 calculator for email addresses
View uuidv5-email.js
var crypto = require('crypto');
var nsURL = new Buffer([0x6b,0xa7,0xb8,0x11,0x9d,0xad,0x11,0xd1,0x80,0xb4,0x00,0xc0,0x4f,0xd4,0x30,0xc8]);
var emailUUID = function(email) {
var shasum = crypto.createHash('sha1');
shasum.update(Buffer.concat([nsURL, new Buffer('mailto:'+email)]));
shasum=shasum.digest();
var result = new Buffer(16);
shasum.copy(result, 0, 0, 16);
You can’t perform that action at this time.