Skip to content

Instantly share code, notes, and snippets.

View noopkat's full-sized avatar
🐤
building my own birdfeeder on here

Suz Hinton noopkat

🐤
building my own birdfeeder on here
View GitHub Profile
self.bold = function(state) {
self.printer.write(esc);
self.printer.write(chr(69));
// 0 || 'off' = off
// 1 || 'on' = on
self.printer.write(chr(state));
}
@tmpvar
tmpvar / currency-to-number.js
Created April 15, 2015 01:56
turn a non-degenerate formatted monetary amount and convert it to a number
var input = [
'$10.000,00',
'$10,000.00',
'$10,000.00 ',
'$10,,,000.00 ',
'$10,0,0,0.00 ',
'$10,000',
'$10,000',
'$10000',
'10000',
@will
will / gist:4198815
Created December 3, 2012 22:44
Gists and oAuth warning

Warning: Do not give third party apps the "create and edit gists" scope, if you have any private data in private gists.

me:

when I grant that privilege to a 3rd party app over oauth, not the web interface.

This dialog: http://f.cl.ly/items/3y1q1s2C2Z321y150F1B/Authorize%20access%20to%20your%20account.png

Create makes sense, they can create them on my behalf. But edit is much more ambiguous. Can that app edit the ones it creates itself? Or any gist I have? Or just the public ones?

@max-mapper
max-mapper / readme.md
Last active October 30, 2015 03:05
node.js release questions

As a maintainer of native node add-on modules I have some questions about when and why NODE_MODULE_VERSION changes:

(@rvagg has anwered these in the comments below)

@torgeir
torgeir / raspberry-pi-2-node-4.2.2-serialport-2.0.2.log
Last active November 7, 2015 17:53
Installing serialport@2.0.2 on node 4.2.2 on the Raspberry Pi 2 - Raspbian GNU/Linux 7 (wheezy)
pi@bekkpi2 ~ $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
..
pi@bekkpi2 ~ $ source ~/.nvm/nvm.sh
..
pi@bekkpi2 ~ $ nvm install 4.2.2
..
pi@bekkpi2 ~ $ cat /etc/*-release
@tmpvar
tmpvar / .gitignore
Last active December 19, 2015 14:28
vegasjs - super lightning talk
node_modules
#!/usr/bin/env node
if (process.argv.length < 4) {
return console.log('usage: togif 25 path/to/files/*.jpg path/to/output.gif');
}
// node expands *.jpg
var images = process.argv.slice(2);
var delay = images.shift();
@tmpvar
tmpvar / leapmotion-servofinger.js
Last active December 31, 2015 22:09
leap motion to servofinger experiment
var five = require("johnny-five");
var ws = new (require('ws'))('ws://localhost:6437');
ws.on('open', console.log.bind(console, 'connected'));
ws.on('error', console.log.bind(console, 'ERROR:'));
(new five.Board()).on("ready", function() {
var servo = new five.Servo(11);
ws.on('message', function(data) {
@amk221
amk221 / document-events.js
Last active January 13, 2016 19:38
Ember.js: Easier document-level event handling
var app = Ember.Application.create();
app.DocumentEventsMixin = Ember.Mixin.create({
$doc: $(document),
documentCallbacks: {},
addDocumentEvents: function() {
this.eachDocumentEvent(function(name, callback) {
this.$doc.on(name, callback);
}.bind(this));
client
.refresh()
.then(function () {
return client.get(); // return your promise
})
.then(function (result) {
// result is the return of client.get()
})
.catch(function (err) {
// common handler for any broken promise now