This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let prevGCmd = null; | |
const previewCode = gcode | |
.split('\n') | |
.map((i) => { | |
const line = i.trim(); | |
let result = line; | |
if (line.charAt(0) == 'G') { | |
const gCmd = new RegExp(/G\d+/g); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let prevGCmd = null; | |
const previewCode = gcode | |
.split('\n') | |
.map((i) => { | |
const line = i.trim(); | |
let result = line; | |
if (line.startsWith('G20')) { // keep as is | |
return result; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am remcoder on github. | |
* I am remcoder (https://keybase.io/remcoder) on keybase. | |
* I have a public key ASBDlmmbx10FUv-0UQt1gbgecJ-rPFYJbTQdNGCm_KpH5wo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/sleep.h> | |
// Utility macros | |
#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC (before power-off) | |
#define adc_enable() (ADCSRA |= (1<<ADEN)) // re-enable ADC | |
const int ledPin1 = 1; | |
const int ledPin2 = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/sleep.h> | |
// Utility macros | |
#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC (before power-off) | |
#define adc_enable() (ADCSRA |= (1<<ADEN)) // re-enable ADC | |
const int ledPin1 = 1; | |
const int ledPin2 = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fast, incremental Lua uploads for NodeMCU | |
INSTALLATION | |
1. This script requires nodemcu-uploader and gulp to be installed globally: | |
$ npm install -g gulp | |
$ npm install -g nodemcu-tool | |
$ pip install nodemcu-uploader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Classes = new Mongo.Collection(‘classes’); | |
Classes.insert({ | |
location: "Aa en Hunze", | |
schoolType: "Basisonderwijs", | |
route: "42", | |
active: true | |
}); | |
<button data-action=continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function registerUnderscoreHelpers() { | |
for (key in _) { | |
var prop = _[key]; | |
if (typeof(prop) == 'function' ) { | |
createUnderscoreHelper(key, prop); | |
} | |
} | |
} | |
// Spacebars always passes an extra argument to the helper, an |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A KITT scanner made out of 12 deep red LEDs hooked up to nothing but an ATTiny85. | |
// It leverages the magic of charlieplexing to enable the ATTiny to drive those 12 LED's with just 4 pins. | |
// | |
// video: http://www.youtube.com/watch?v=MYvrKLcG-Vg | |
const int blue = 0; | |
const int green = 1; | |
const int red = 2; | |
const int white = 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I recently got one of those 8x8 LED matrices and I was playing with some Game of Life patterns when I found this pretty repeating pattern. I found it by starting with some random patterns. If you look closely you can see the pattern becoming a mirrored version of itself halfway through. Apparently the pattern doesn't repeat like this on an infinite grid but on this wrapping 8x8 grid it does ;-) | |
FYI, the LED matrix is a bicolor one (green/red) and has an I2C interface (http://www.adafruit.com/products/902). I'm using the colors as follows: | |
- newly created cells are green | |
- cells that are at least 10 generations old are red | |
- other living cells are yellow (simultaneously green+red) | |
It's hookup up to my Arduino Uno r3. |
NewerOlder