Skip to content

Instantly share code, notes, and snippets.

View bcoe's full-sized avatar
💭
hackin'

Benjamin E. Coe bcoe

💭
hackin'
View GitHub Profile
ProductName: Mac OS X
ProductVersion: 10.13.4
BuildVersion: 17E199
@bcoe
bcoe / fail-on-threshold.patch
Created January 23, 2019 23:53
fail-on-threshold.patch
diff --git a/Makefile b/Makefile
index 9fcf7e08701..852697c53fd 100644
--- a/Makefile
+++ b/Makefile
@@ -215,7 +215,7 @@ coverage-build: all
coverage-build-js:
mkdir -p node_modules
if [ ! -d node_modules/c8 ]; then \
- $(NODE) ./deps/npm install c8@next --no-save --no-package-lock;\
+ $(NODE) ./deps/npm install c8 --no-save --no-package-lock;\
@bcoe
bcoe / sanitize_string.rb
Last active July 10, 2018 14:50
Sanitize a search query for Lucene. Useful if the original query raises an exception, due to bad adherence to DSL. Taken from a discussion on Stack Overflow: http://stackoverflow.com/questions/16205341/symbols-in-query-string-for-elasticsearch
module ElasticSearchHelpers
# sanitize a search query for Lucene. Useful if the original
# query raises an exception, due to bad adherence to DSL.
# Taken from here:
#
# http://stackoverflow.com/questions/16205341/symbols-in-query-string-for-elasticsearch
#
def self.sanitize_string(str)
# Escape special characters
# http://lucene.apache.org/core/old_versioned_docs/versions/2_9_1/queryparsersyntax.html#Escaping Special Characters
@bcoe
bcoe / monthly.md
Last active July 4, 2018 00:36
Devtools Community Triage - July 3rd 2018

Devtools Community Monthly Triage

  • Who: Contributors and community members interested in shaping the yargs, lerna, conventional-changelog, and nyc projects.
  • What: Our monthly planning meeting for the Devtools Community umbrella of projects.
  • When: Tuesday, July 3, 4:30PM.
  • Where: https://zoom.us/, download the Zoom chat application, a meeting room will be shared in slack.

Agenda

yargs:

@bcoe
bcoe / github-access-control.js
Created May 15, 2018 17:10
github-access-control.js
function (user, context, callback) {
// We check users only authenticated with 'github'
if(context.connection === 'github'){
var whitelist = [
'bcoe',
'batman'
]; //authorized github accounts.
var userHasAccess = whitelist.some((name) => {
return name === user.nickname;
@bcoe
bcoe / happn-primus-readme.md
Created June 3, 2017 18:38
happn-primus-readme.md

moved package "lws": "0.6.x", to 0.8.0

removed uws support

Primus

Version npmBuild StatusDependencies

Primus, the creator god of transformers but now also known as universal wrapper for real-time frameworks. There are a lot of real-time frameworks available for

@bcoe
bcoe / package.json
Created May 17, 2017 19:13
package.json
{
"name": "@funkia/hareactive",
"version": "0.0.31",
"description": "Experimental FRP library for building web applications.",
"main": "dist/index.js",
"module": "dist/es/index.js",
"typings": "dist/defs/index.d.ts",
"directories": {
"test": "test",
"dist": "dist"
@bcoe
bcoe / ha.varnish
Created April 25, 2017 17:28
ha.varnish
vcl 4.0;
import directors;
backend primary {
.host = "127.0.0.1";
.port = "8080";
}
backend replica {
.host = "x.x.x.x";
@bcoe
bcoe / couch-debug-level.txt
Created March 23, 2017 15:50
couch-debug-level.txt
curl -XPUT /_config/log/level' -d '"debug"'
@bcoe
bcoe / lerna-bundle.txt
Created February 6, 2017 19:29
lerna-bundle.txt
For yargs, I'm picturing a structure something like this:
yargs
lib
command.js
validation.js
packages:
yargs-parser
index.js
package.json