Skip to content

Instantly share code, notes, and snippets.

View dromer's full-sized avatar
🌴
On vacation

dreamer dromer

🌴
On vacation
View GitHub Profile
@dromer
dromer / LAG-SpaceAPI.php
Last active August 29, 2015 14:00
]( LAG SpaceAPI in PHP
<?php
$thekey = "PASSWORDGOESHERE";
function displaystate(){
$file = "spaceapi.json";
$json = json_decode(file_get_contents($file), true);
$nowstate = $json['state']['open'];
echo "<div align=center style='color:#BDBDBD'>";
#include <LiquidCrystal.h>
#include <Firmata.h>
byte pin;
int analogValue;
int previousAnalogValues[TOTAL_ANALOG_PINS];
byte portStatus[TOTAL_PORTS]; // each bit: 1=pin is digital input, 0=other/ignore
@dromer
dromer / willie-mpd
Created June 11, 2014 17:19
fix to display filename if tags are missing
if ((mpdcommand == 'playing') or (mpdcommand == 'state')) :
currentsong = client.currentsong()
currentstatus = client.status()
if 'artist' in currentsong and 'title' in currentsong:
nowplaying = currentsong['artist'] + ' - ' + currentsong['title']
elif 'artist' in currentsong:
nowplaying = currentsong['artist']
elif 'title' in currentsong:
nowplaying = currentsong['title']
import time
import willie
import re
from willie.module import commands, interval
INTERVAL = 5
SPACESTATE = "unknown"
CHANNEL = "#lag"
@dromer
dromer / 81-thinkpad-dock.rules
Created December 14, 2014 21:46
thinkpad dock udev rule
KERNEL=="dock.2", ACTION=="change", RUN+="/usr/local/sbin/thinkpad-dock.sh"
@dromer
dromer / thinkpad-dock.sh
Created December 14, 2014 21:48
thinkpad dock change script
#!/bin/sh
exec >/home/dreamer/udev.out 2>&1
# wait for the dock state to change
sleep 0.5
DOCKED=$(cat /sys/devices/platform/dock.2/docked)
export XAUTHORITY=/home/dreamer/.Xauthority
export DISPLAY=:0
case "$DOCKED" in
"0")
#undocked event - lets remove all connected outputs apart from LVDS
@dromer
dromer / .vimrc
Created January 7, 2015 15:55
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
@dromer
dromer / lagspacebutton.ino
Last active February 5, 2016 21:33
button that spaces
/**
* lagspacebutton.ino
*
* Created on: 29.01.2016
*
*/
#include <Arduino.h>
#include <ESP8266WiFi.h>
@dromer
dromer / mod2mp3.sh
Created March 29, 2016 21:56
convert mod files to mp3s
#! /bin/bash
for f in $(ls *.MOD);
do
xmp -o - -d wav "$f" | avconv -i - -b 320k "$f.mp3"
done
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
//needed for library
#include "Freepin_WS2801.h"
ESP8266WiFiMulti WiFiMulti;
const char* ssid = "PIEMELS";