Skip to content

Instantly share code, notes, and snippets.

View ajfisher's full-sized avatar

ajfisher ajfisher

View GitHub Profile
@ajfisher
ajfisher / gist:1061793
Created July 2, 2011 23:48
Make an RGB LED show different colours based on range finder distance
/*
WARMER COOLER GAME
Use a ping sensor to determine distance and then depending on the distance,
show warmer or cooler colours.
Built using a ping))) Sensor and connected to a RGB display.
Uses the ping))) example in the base Arduino install, written by David Mellis & Tom Igoe
http://www.arduino.cc/en/Tutorial/Ping
@ajfisher
ajfisher / tsana.py
Created October 16, 2011 05:38
Twitter Stream Analyser and Network Activator - watches twitter stream for keywords and hits a URL when it finds one.
# Twitter stream analyser and network activator (TSANA)
#
# This script analyses a twitter stream for keywords using the twitter
# streaming api - off the back of it, it then hits a user defined url
# In my case this is being used to tell an Arduino to pulse a light but
# could be used for anything arbitrary.
#
# Author: Andrew Fisher
# Version: 0.3
# Date: 20/10/2011
@ajfisher
ajfisher / generic_network_pulser.pde
Created October 16, 2011 08:42
Pulse an arduino PWM pin by hitting a URL over the network
/**
Generic networked pulser
Sets up a web page and every time a url is hit then it conducts and action
Author: Andrew Fisher
Date: 29 September 2011
Version 0.2
@ajfisher
ajfisher / networked_temperature_sensor.pde
Created October 16, 2011 09:06
Basic networked temperature sensor that displays a web page for arduino
/**
Basic Networked temperature sensor.
Displays a web page with the temperature on it.
Author: Andrew Fisher
Date: 30 September 2011
Version 0.1
@ajfisher
ajfisher / tsasa.py
Created January 15, 2012 09:50
Send a twitter message to a serial connection on an arduino
# Twitter stream analyser and serial activator (TSASA)
#
# This script analyses a twitter stream for keywords using the twitter
# streaming api - off the back of it, it then makes a serial request passing
# the message across to the serial device
#
# This was done fopr LCA2012 as an extension to the more code generator that
# Luke Weston build for the LeoStick
#
#
@ajfisher
ajfisher / colour_converter.py
Created May 30, 2012 06:56
Convert an 888 RGB value to 565 hex
# Author: Andrew Fisher
# Version: 0.1
# Date: 30/05/2012
# Licence: BSD
# This python converts an rgb value expressed in 8 bit values (eg 255, 128, 0) and returns a hex value that
# has been converted to 565 format. This was highly useful when I was playing with some Arduino
# stuff requiring 16 bit LCD designs and couldn't remember the hex layout.
def rgb_hex565(red, green, blue):
@ajfisher
ajfisher / LICENSE
Last active December 4, 2018 20:42
Set up some Christmas lights to pulse depending on keywords being made on twitter
Copyright (c) Andrew Fisher and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@ajfisher
ajfisher / .bash_aliases
Last active October 16, 2023 03:30
My vimrc file
alias fritzing='~/fritzing/fritzing-0.8.0b.linux.AMD64/Fritzing'
alias avahi='avahi-browse --all'
@ajfisher
ajfisher / twitter-fix.md
Last active March 1, 2018 06:42
CSS fixes to Twitter web client to remove all the inline previews

Twitter Web Client Inline Image Removal

If you're a heavy user of the Twitter web client like me then you'll find the new inline preview feature extremely intrusive as it breaks up the timeline too much. If I wanted to use facebook or linkedin then I'd be using facebook or linkedin. Having said that, cards in Twitter are great and the ability to preview media before jumping off site is really cool - but it should be my choice, not have everything foisted on my timeline.

That the mobile client allows for this with a setting is even more annoying.

So here's the fix. This only works in Chrome but I'm sure an enterprising person could do something similar for Safari and Firefox using the same CSS. Pull requests to update instructions for other browsers are of course very welcome.

Updates

@ajfisher
ajfisher / firmatatest.js
Last active December 22, 2019 08:15
Serial comms over hardware UART for Johnny-Five between Arduino and a Raspberry Pi
var firmata = require('firmata');
var repl = require('repl');
var board = new firmata.Board('/dev/ttyAMA0',function(err){
//arduino is ready to communicate
if (err) {
console.log("err:" + err);
return;
}
console.log("Firmata Firing LEDs");