Skip to content

Instantly share code, notes, and snippets.

View boneskull's full-sized avatar
💀

Christopher Hiller boneskull

💀
View GitHub Profile
@boneskull
boneskull / README.md
Created January 8, 2019 23:00
sorts working copies into subdirs by GitHub org name

Given a directory full of working copies, like ~/projects, this script helps sort them into subdirectories based on org name. It inspects Git remote names and URLs to do so.

Currently doesn't handle forks very well, because git doesn't know what a fork is.

NOTE TO SELF: Hub is helpful. Use hub clone and hub fork --remote-name=origin rather than clicking the big green "Fork" button, as this sets up origin/upstream remotes properly.

@boneskull
boneskull / README.md
Created July 26, 2018 22:39
How to Use an ESP8266 w/ Johnny-Five

How to Use an ESP8266 w/ Johnny-Five by boneskull

Prerequisite Software

  • Node.js v8.x
  • Arduino IDE v1.8.5
  • CP2104 driver (found linked here)

A toolchain to build native modules may be required. windows-build-tools may be the quickest way to get setup on Windows. macOS users will need to install XCode; Linux users will need to install build-essential, python, and likely some other stuff.

Add ESP8266 Board Support to Arduino IDE

@boneskull
boneskull / README.md
Last active November 12, 2021 22:45
MicroPython on ESP32: MQTT and DS18B20 temperature sensor full example

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps

  1. what is a parser?
  2. and.. what is a parser combinator?

So first question: What is parser?

@boneskull
boneskull / .babelrc
Created December 11, 2017 16:26
minimal mocha + babel setup to show import/export working
{
"presets": ["env"]
}
@boneskull
boneskull / README.md
Last active April 10, 2024 12:47
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
@boneskull
boneskull / readme.md
Created September 11, 2017 16:37
how can I do this

Say we have a JS library, and that library exports an API.

For the sake of argument, that library could be mocha and the API could be the "BDD" interface:

describe('my suite', function () {
  it('should timeout in 10s', function (done) {
    this.timeout(10);
    setTimeout(done, 9000);
 });
@boneskull
boneskull / mocha.xml
Created August 26, 2017 08:12
Live templates for Mocha for use in JetBrains' IDEs
<templateSet group="Mocha">
<template name="desc" value="describe('$DESC$', function() {&#10; $END$&#10;});" description="makes a describe block" toReformat="true" toShortenFQNames="true">
<variable name="DESC" expression="jsMethodName()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_SCRIPT" value="true" />
</context>
</template>
<template name="be" value="beforeEach(function() {&#10; $END$&#10;});" description="beforeEach" toReformat="true" toShortenFQNames="true">
<context>
<option name="JAVA_SCRIPT" value="true" />
@boneskull
boneskull / svg-ellipsis.directive.ts
Created June 26, 2017 19:38
Angular directive to simulate "text-overflow: ellipsis" on an SVG text node
/**
* @see https://stackoverflow.com/questions/15975440/add-ellipses-to-overflowing-text-in-svg
* @example
* <!-- truncate at 200px -->
* <svg><svg:text ellipsis [text]="text to truncate" [width]="200"></svg:text></svg>
*/
import {
Directive,
ElementRef,
@boneskull
boneskull / .block
Created May 7, 2017 08:35
fiddling w snapsvg
license: mit