Skip to content

Instantly share code, notes, and snippets.

@andrewn
andrewn / atom-esformatter-install.js
Last active January 10, 2016 12:47
Simple script to install your projects esformatter plugins in the atom-esformatter package
var fs = require('fs');
var path = require('path');
var spawn = require('child_process').spawn;
var esformatterPath = process.argv[2];
var homeDir = (process.platform === 'win32') ? process.env.HOMEPATH : process.env.HOME;
var atomPackagePath = path.join(homeDir, '.atom', 'packages', 'esformatter');
var config;
var plugins;
var cmd;
@andrewn
andrewn / hello-button.js
Created January 3, 2016 17:08
Testing jonnny-five button class with internal pull up resistor
var five = require('johnny-five'),
RaspiIO = require('raspi-io');
var board;
board = new five.Board({
io: new RaspiIO(),
repl: true
});
@andrewn
andrewn / README.md
Last active December 30, 2015 19:39
Speaker images

Speaker images for Solidcon proposal

<!DOCTYPE html>
<html>
<head>
<title>The Pips</title>
</head>
<body>
<button onclick="pips()">The Pips</button>
<script src="pips.js"></script>
</body>
@andrewn
andrewn / config.ru
Created October 8, 2013 13:43
Run PHP scripts via pow.cx
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
INDEXES = ['index.html','index.php', 'index.cgi']
base_path = Dir.getwd
base_path = "/Users/andrew/Projects/oss/tal/talexample"
use Rack::Rewrite do
@andrewn
andrewn / app.css
Last active December 24, 2015 11:39
Attempt at blink detection
canvas {
margin: 0 auto;
-moz-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1);
filter: FlipH;
transform: scale(-1, 1);
}
@andrewn
andrewn / gist:6352695
Last active December 21, 2015 19:09
USB Soundcard default
To make a USB souncard default:
1. Open `sudo nano /etc/modprobe.d/alsa-base.conf`
2. Comment out the following line: `#options snd-usb-audio index=-2`
3. Reboot
4. Check that USB audio is at the top of this list `cat /proc/asound/modules`
@andrewn
andrewn / gist:6320683
Last active December 21, 2015 14:38
HTTP 511Network authentication required
<html>
<head>
<title>Network Authentication Required</title>
<meta http-equiv="refresh"
content="0; url=http://raspberrypi.local/">
</head>
<body>
<p>You need to <a href="http://raspberrypi.local/">
configure a Wi-Fi network</a> to gain access.</p>
</body>
@andrewn
andrewn / instructions.md
Created August 21, 2013 16:23
Starting services as daemons on Raspbian
  • Save the script as /etc/init.d/raspi-printer
  • Make it executable chmod +x /etc/init.d/raspi-printer
  • Start by doing service raspi-printer start

To run automatically, you run the update-rc.d script:

sudo update-rc.d -f raspi-printer defaults

See: http://jimmyg.org/blog/2010/python-daemon-init-script.html

<!DOCTYPE html>
<html>
<head>
<title>Remote</title>
<style type="text/css">
body {
font-family: sans-serif;
font-size: 4em;
}
#wrapper {