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
Last active December 16, 2025 11:19
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
@boneskull
boneskull / .block
Created May 7, 2017 08:35
fiddling w snapsvg
license: mit
@boneskull
boneskull / .block
Last active April 11, 2017 19:25
fresh block
license: mit
@boneskull
boneskull / main.yml
Last active February 10, 2023 21:08
Node-RED Ansible role (Debian & derivatives)
---
# This task just includes everything else we need
- include_role:
# a task to install nodejs from Nodesource's distros
name: nodejs
- include_role:
# a task to install nginx
name: web
# everything below here is in this gist
- include: prerequisites.yml
@boneskull
boneskull / .babelrc
Created February 5, 2017 19:19
babel bug with polyfill and async function in same module
{
"presets": [
[
"env",
{
"targets": {
"node": 4
}
}
]
@boneskull
boneskull / keybase.md
Created January 29, 2017 10:48
keybase.md

Keybase proof

I hereby claim:

  • I am boneskull on github.
  • I am boneskull (https://keybase.io/boneskull) on keybase.
  • I have a public key ASA2SWhelHgPkaVgFSjjGewaMahzlqWtobK3ciwLKWoEGAo

To claim this, I am signing this object: