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 April 21, 2024 20:12
Run glances webserver as a user service (agent) on macOS

com.boneskull.glances-web

This launch agent will automatically start a glances web server

Installation

  1. Install Homebrew.
  2. Install glances. Execute brew install glances.
  3. Copy the .plist file in this gist into ~/Library/LaunchAgents/.
  4. EDIT the .plist: change /Users/boneskull/ to /Users//
@boneskull
boneskull / README.md
Last active February 26, 2019 04:48
OpenVPN client + Deluge daemon setup

This is my setup which automatically binds Deluge to the IP assigned by the OpenVPN server.

Assumes OpenVPN client uses the tun0 interface.

It's theoretically subject to race conditions, but have not had problems so far. There's probably a better way to do this, but I'm no systemd whiz.

Requires sponge be present (apt-get install sponge); was running into permissions problems when allowing sed to create a temp file.

Suggestions welcome!

@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" />