Skip to content

Instantly share code, notes, and snippets.

View unknowndomain's full-sized avatar
💭
🏳️‍🌈

Tom Lynch unknowndomain

💭
🏳️‍🌈
View GitHub Profile
@unknowndomain
unknowndomain / gist:4079329
Created November 15, 2012 15:52
POT Code
void setup() {
pinMode( A0, INPUT );
pinMode( A1, INPUT );
pinMode( A2, INPUT );
Serial.begin( 9600 );
}
void loop() {
Serial.print( analogRead( A0 ) );
Serial.print( "," );
@unknowndomain
unknowndomain / gist:4079382
Created November 15, 2012 16:00
Cube interface
import processing.serial.*;
Serial arduino;
float history[][] = new float [10][3];
float xRotationSpeed = 0;
float yRotationSpeed = 0;
float zRotationSpeed = 0;
@unknowndomain
unknowndomain / The Maker's Bill of Rights.md
Last active December 14, 2015 11:49
The Maker's Bill of Rights

#The Maker's Bill of Rights

  1. Meaningful and specific parts lists shall be included.
  2. Cases shall be easy to open.
  3. Batteries should be replaceable.
  4. Special tools are allowed only for darn good reasons.
  5. Profiting by selling expensive special tools is wrong and not making special tools available is even worse.
  6. Torx is OK; tamperproof is rarely OK.
  7. Components, not entire sub-assemblies, shall be replaceable.
  8. Consumables, like fuses and filters, shall be easy to access.
import oscP5.*;
import netP5.*;
import processing.video.*;
import com.google.zxing.*;
import java.awt.image.BufferedImage;
// Camera & ZXing objects
Capture cam;
com.google.zxing.Reader reader = new com.google.zxing.qrcode.QRCodeReader();
@unknowndomain
unknowndomain / pre_get_posts.php
Created July 21, 2013 19:10
This code will ensure that all WordPress custom post types appear in the main blog loop/query on the home page as if they were normal posts.
function pre_get_posts( $query ) {
if ( $query->is_main_query() && ! $query->is_admin && $query->is_home ) {
$post_types = get_post_types( array(
'public' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'show_ui' => true,
'hierarchical' => false
) );
@unknowndomain
unknowndomain / scale-html.js
Created August 28, 2013 17:45
This node script uses optimist, and jQuery to read in a passed file and rescale the elements to a specified width, useful time saver...
var argv = require('optimist').argv;
var fs = require('fs');
var $ = require('jQuery');
// Determine Max Width
var maxWidth = 700;
if ( argv.maxWidth != undefined ) {
maxWidth = argv.maxWidth;
} else if ( argv.w != undefined ) {
maxWidth = argv.w;
@unknowndomain
unknowndomain / gist:7847754
Created December 7, 2013 19:55
Tinkering with Twilio TwiML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello. The door to South London Makerspace been left open for over 10 minutes.</Say>
<Hangup/>
</Response>
@unknowndomain
unknowndomain / gist:b090c960000ef17d9b4a
Last active August 29, 2015 13:57
Bookmarklet to maximise the video window in iPlayer, also now supports All4.
javascript:(function() {var video=document.querySelector('.odPlayer-frame,#player-container').style;video.position='fixed';video.zIndex=1000;video.top=0;video.left=0;video.bottom=0;video.right=0;video.background='black';video.width='100%';video.height='100%';video.padding='0';})();
@unknowndomain
unknowndomain / etch_a_sketch.pde
Last active August 29, 2015 14:07
A simple etch-a-sketch sketch takes a CSV input from Arduino x,y,clear. Also has a save command (key: s).
import processing.serial.*;
Serial arduino;
int x = 0;
int y = 0;
int prev_x = 0;
int prev_y = 0;
void setup() {
@unknowndomain
unknowndomain / etch_a_sketch.ino
Created September 29, 2014 23:09
A simple etch-a-sketch sketch takes a two analog inputs and a digital input and outputs them in CSV format.
#define X_POT A0
#define Y_POT A1
#define CLR_BTN 7
void setup() {
pinMode( X_POT, INPUT );
pinMode( Y_POT, INPUT );
pinMode( CLR_BTN, INPUT );
Serial.begin( 9600 );