Skip to content

Instantly share code, notes, and snippets.

View reinvented's full-sized avatar

Peter Rukavina reinvented

View GitHub Profile
@reinvented
reinvented / pei-vcard-shim.js
Created November 24, 2011 15:10
Beginnings of a node.js script to act as a web search to LDAP shim
// https://github.com/mattt/vcard.js
require('./vcard.js');
// https://github.com/silentrob/Apricot
var Apricot = require('apricot').Apricot;
// http://nodejs.org/docs/latest/api/http.html
var http = require('http');
// http://nodejs.org/docs/latest/api/util.html
@reinvented
reinvented / SubjectFilter.scpt
Created December 14, 2011 19:19
Applescript to test length of incoming mail's Subject line and reply with a warning for short subject.
on perform_mail_action(info)
-- Definition of a Carriage Return. You don't need to change this.
set crlf to (ASCII character 13) & (ASCII character 10) & (ASCII character 13) & (ASCII character 10)
-- My name is… (set to your own first name; it's used at the end of the email)
set myName to "Peter"
-- The first part of the automatic reply to be sent... you want to customize this. The sender's subject gets tacked on the end.
set theReplyOne to "Hi there," & crlf & "You recently sent me an email message with the very short subject of '"
@reinvented
reinvented / energy-nabaztag.php
Created January 3, 2012 21:17
Send PEI Energy Interchange report to a Nabaztag rabbit
<?php
$apiKey = "get this from nabaztag.com";
$localDir = "/www/htdocs-ruk/nabaztag/wav";
$webDir = "http://media.ruk.ca/nabaztag/wav";
$id = uniqid();
$nbso = simplexml_load_file("http://energy.reinvented.net/pei-energy/nbso/get-nbso-data.php?format=xml");
$message = "P E I energy interchange is " . $nbso->PEI . " megawatts";
system("/usr/local/bin/swift \"" . escapeshellarg($message) . "\" -o $localDir/$id.wav");
$fp = fopen("http://www.nabalive.com/nabaztags/$apiKey/play?url=" . urlencode("$webDir/$id.wav"),"r");
?>
@reinvented
reinvented / create-trac-ticket.php
Created November 4, 2012 15:32
PHP script to use as a target for Postmark Inbound webhooks to create Trac tickets
<?php
include 'Mail.php';
include 'Mail/mime.php' ;
define("MAIL_MIME_CRLF","\r\n");
$json = file_get_contents('php://input');
$email = json_decode($json);
@reinvented
reinvented / send-trac-ticket.applescript
Created November 5, 2012 19:19
An AppleScript to use with Alfred.app to create a new Trac ticket by email
on alfred_script(q)
tell application "Mail"
set myMessage to make new outgoing message with properties {visible:true, subject: q}
set message signature of myMessage to signature "trac"
tell myMessage
make new to recipient with properties {name:"Trac", address:"ticket@example.com"}
end tell
activate
end tell
end alfred_script
@reinvented
reinvented / leave-the-office.scpt
Created November 26, 2012 18:45
AppleScript to sign off Adium and Skype, close Bria and stop Rdio.
tell application "Rdio" to pause
tell application "Adium" to go away
tell application "Skype"
send command "SET PROFILE MOOD_TEXT " & "Left office at " & time string of (current date) script name "Phidgets"
send command "SET USERSTATUS OFFLINE" script name "Phidgets"
end tell
tell application "Bria 3"
quit
end tell
@reinvented
reinvented / index.html
Created June 29, 2013 18:48
Oliver thinks his devices may be betraying him!
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@reinvented
reinvented / peter-home-office.geojson
Created August 13, 2013 01:34
My Home and Office
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reinvented
reinvented / map.geojson
Created August 13, 2013 01:51
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@reinvented
reinvented / map.geojson
Created August 13, 2013 01:51
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.