Skip to content

Instantly share code, notes, and snippets.

@vampjaz
vampjaz / Adafruit_CharLCDPlate.py
Last active December 20, 2015 10:49
A simple python script for RASPBERRY PI to display prices and quantities of various SparkFun Products
#!/usr/bin/python
# Python library for Adafruit RGB-backlit LCD plate for Raspberry Pi.
# Written by Adafruit Industries. MIT license.
# This is essentially a complete rewrite, but the calling syntax
# and constants are based on code from lrvick and LiquidCrystal.
# lrvic - https://github.com/lrvick/raspi-hd44780/blob/master/hd44780.py
# LiquidCrystal - https://github.com/arduino/Arduino/blob/master/libraries/LiquidCrystal/LiquidCrystal.cpp
@vampjaz
vampjaz / SparkfunChar.ino
Last active December 20, 2015 22:29
A simple Arduino script to display the Sparkfun logo and SparkFun!! on a HD44780 LCD screen. See https://lh6.googleusercontent.com/_L0Eke9UQNQJukJq1SFx7ZevKHVCGhQ6FiI92qOs1yMNd-CIVs9OLxAx1cneC-sp1g=s400 for a picture
/*
The Sparkfun logo is intellectual property of Sparkfun Inc.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
@vampjaz
vampjaz / form1.pde
Last active August 29, 2015 13:57
Several cellular automata I invented with processing
int x,y;
int direction;
int w = 500;
int h = 500;
int on = (int)color(0,0,0); //black = on
int off = (int)color(255,255,255); //white = off
void setup() {
@vampjaz
vampjaz / jasper-setup.sh
Created April 13, 2014 14:50
Automatic setup and install of Jasper (http://jasperproject.github.io/)
#!/bin/bash
# Jasper install script (http://jasperproject.github.io/)
# Must be run as root (i.e. sudo setup.sh)
apt-get update
apt-get upgrade --yes
apt-get install vim git-core espeak python-dev python-pip bison libasound2-dev libportaudio-dev python-pyaudio subversion autoconf libtool automake gfortran --yes
sed "s/options snd-usb-audio index=-2/options snd-usb-audio index=0" /etc/modprobe.d/alsa-base.conf>/etc/modprobe.d/alsa-base.conf
r=Math.random;w=$(window);setInterval("$('<b>★</b>').css({color:'gold',position:'fixed',top:r()*w.height(),left:r()*w.width()}).appendTo('body').animate({fontSize:0},3e3)",9)
r=Math.random;w=$(window);setInterval("$('<b>♦</b>').css({color:'blue',position:'fixed',top:r()*w.height(),left:r()*w.width()}).appendTo('body').animate({fontSize:0},3e3)",9)
r=Math.random;w=$(window);setInterval("$('<b>★</b>').css({color:'gold',position:'fixed',top:r()*w.height(),left:r()*w.width()}).appendTo('body')",9)
@vampjaz
vampjaz / Irc.py
Created July 14, 2014 16:26
Mniip's minimal framework for IRC, with improvements by me
import socket, errno, time
from string import maketrans
ircupper = maketrans(
"abcdefghijklmnopqrstuvwxyz[]~\\",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ{}^|")
def parse(cmd):
data = cmd.split(" ")
if data[0][0] != ':':
@vampjaz
vampjaz / letters.py
Created November 24, 2014 15:59
Print out large ASCII block letters using python
letters = { "a":[ "###", "# #", "###", "# #", "# #"], "b":[ "###", "# #", "###", "# #", "###"], "c":[ "###", "#", "#", "#", "###"], "d":[ "##", "# #", "# #", "# #", "##"], "e":[ "###", "#", "###", "#", "###"], "f":[ "###", "#", "###", "#", "#"], "g":[ "###", "# #", "###", " #", "###"], "h":[ "# #", "# #", "###", "# #", "# #"], "i":[ "###", " #", " #", " #", "###"], "j":[ "###", " #", " #", " #", "##"], "k":[ "# #", "##", "#", "##", "# #"], "l":[ "#", "#", "#", "#", "###"], "m":[ "# #", "###", "###", "# #", "# #"], "n":[ "###", "# #", "# #", "# #", "# #"], "o":[ "###", "# #", "# #", "# #", "###"], "p":[ "###", "# #", "###", "#", "#"], "q":[ "###", "# #", "###", " #", " #"], "r":[ "###", "# #", "##", "# #", "# #"], "s":[ "###", "#", "###", " #", "###"], "t":[ "###", " #", " #", " #", " #"], "u":[ "# #", "# #", "# #", "# #", "###"], "v":[ "# #", "# #", "# #", "# #", " #"], "w":[ "# #", "# #", "# #", "###", "###"], "x":[ "# #", " #", " #", " #", "# #"], "y":[ "# #", "# #", "###", " #", "###"], "z":[ "###", "
@vampjaz
vampjaz / xkcdserv.py
Created November 26, 2014 01:51
Simple xkcd-based page rendered, in python
import socket, threading
import requests
import time, random
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(8)
sock.bind(("",7593))
sock.listen(10)
def handler(con,addr):
@vampjaz
vampjaz / tmux.sh
Created May 30, 2015 18:04
Tmux Server monitoring script
#!/bin/bash
SESSION=$USER
# requires tmux, speedometer, htop
# speedometer = network graphs
# htop = better cpu usage
# btcwatch.sh and dogewatch.sh simply call ./<coin>-cli getinfo every 30 seconds
# leaves a pane open to shell
# borrowed some code from http://blog.htbaa.com/news/tmux-scripting
@vampjaz
vampjaz / coolfractal.ino
Created September 9, 2015 14:56
Coolfractal on a nokia 5110 GLCD
/*********************************************************************
This is an example sketch for our Monochrome Nokia 5110 LCD Displays
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/338
These displays use SPI to communicate, 4 or 5 pins are required to
interface
Adafruit invests time and resources providing this open source code,