Skip to content

Instantly share code, notes, and snippets.


Julien Vanier monkbroc

View GitHub Profile
monkbroc / usb_to_uart.ino
Last active Sep 21, 2018
Particle Photon USB to UART passthrough
View usb_to_uart.ino
/* Pass through all data from USB serial to UART serial (TX/RX pins)
void setup() {
monkbroc / application.cpp
Created Sep 16, 2018
Hardware accelerated Neopixel for nRF52840
View application.cpp
#include "application.h"
#include "nrfx_pwm.h"
#include "nrf_gpio.h"
#include "pinmap_impl.h"
#define PIXEL_COUNT 44
#define BITS_PER_PIXEL 24
monkbroc / blink.ino
Created Aug 1, 2018
Pass make options to Particle cloud compile
View blink.ino
monkbroc / server.js
Last active Oct 30, 2017
Webhook server
View server.js
/* Simple webserver that logs all requests to /hook to a file
* Usage:
* npm install express
* node server.js
var express = require('express');
var fs = require('fs');
var app = express();
monkbroc / git-amend
Created Jul 29, 2017
Useful git commands
View git-amend
# Save as ~/bin/git-amend then chmod +x ~/bin/git-amend
# Usage: `git amend` to silently amend a previous commit
git commit --amend --no-edit $*
monkbroc / index.js
Last active Jul 10, 2017
Extract the Slack message history per channel for a time period
View index.js
// Extract the Slack message history per channel for a time period
// Gives an idea which Slack channels are most used
// Usage:
// Save SLACK_TOKEN in .env file
// npm install
// npm start | tee slack_channels.csv
const WebClient = require('@slack/client').WebClient;
const Promise = require('bluebird');
const moment = require('moment');
View internet-button-electron.ino
#include "InternetButton.h"
#include "math.h"
/* Let me show you how easy it is to put the Button on the Internet.
Useful info, like how to access the data from your browser, can be
found here:
The code to control the number of illuminated LEDs is here:
Try naming one of your devices "InternetButton" and running controlKnob in your browser or on your phone!
monkbroc / pi_build
Created Nov 30, 2016
Particle on Raspberry Pi local build script
View pi_build
docker run --rm -it -v $FIRMWARE:/firmware -v $PWD:/input -v $PWD:/output particle/buildpack-raspberrypi $*
View pixel-wave.ino
/* Pixel wave
* Copyright 2016 Julien Vanier, MIT license
* Connect 3 photoresistors to analog inputs and drive a Dotstar/Neopixel strip from the 3 analog signals!
#include "application.h"
#include "dotstar/dotstar.h"
monkbroc / index.html
Created Nov 16, 2016
Intense error page
View index.html
<!DOCTYPE html>
<title>MuniRent - Server error (500)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
body { text-align: center; padding: 30px; }
h1 { font-size: 30px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }