Update: I made this a proper blog post
- linux box
node_modules |
<html> | |
<head> | |
<title>Dithering Test</title> | |
</head> | |
<body> | |
<canvas></canvas> | |
<script> | |
var canvas = document.getElementsByTagName("canvas")[0]; |
#!/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(); |
// 1. Go to page https://www.linkedin.com/settings/email-frequency | |
// 2. You may need to login | |
// 3. Open JS console | |
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)) | |
// 4. Copy the following code in and execute | |
// 5. No more emails | |
// | |
// Bookmarklet version: | |
// http://chengyin.github.io/linkedin-unsubscribed/ |
Update: I made this a proper blog post
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) { |
self.bold = function(state) { | |
self.printer.write(esc); | |
self.printer.write(chr(69)); | |
// 0 || 'off' = off | |
// 1 || 'on' = on | |
self.printer.write(chr(state)); | |
} |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
This is a list of JavaScript projects on Github that label issues as easy or beginner-friendly.
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)); |