Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

To claim this, I am signing this object:


Setup Resque on Heroku for Rails 4

Resque depends on Redis, so first install Redis locally to be able to work on your project...

Install Redis locally on Mac

To install Redis locally, use the following approach on Mac OS X (using Homebrew). $ brew install redis

To test your install, firstly ensure that the Redis server is running. $ redis-server

View gmail_to_omnifocus.js
javascript:(function(){var enc=encodeURIComponent,w=window,frames=w.frames,d=document,tn=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pu=w.location.href,\.google\.com/),tt=pt=d.title,subjSpans=d.getElementsByClassName("hP"),i,url;if(isGMail){if(subjSpans){tt=subjSpans[0].innerText}else{tt=d.title.substring(d.title.indexOf("-")+1,d.title.lastIndexOf("-")).replace(/^ +/,"").replace(/ +$/,"")};if(tn!="")tn+="\n\n";tn+="From email subject:("+tt+")\n"+pu;pu=""+enc(tt)+")"};url='omnifocus:///add?note='+enc(tn+"\n"+pu)+'&name='+enc(tt);w.location.href=url})();
View OneName
Verifying that +rogiervandenberg is my blockchain ID.
View getLocalTimeStamp.js
function getLocalTimeStamp () {
var currentDate = new Date();
var currentTime = currentDate.getTime();
var localOffset = (-1) * currentDate.getTimezoneOffset() * 60000;
var stamp = Math.round(new Date(currentTime + localOffset).getTime() / 1000);
return stamp;
View FrontdoorSensorReedSensor.ino
//To make more serial ports
#include <SoftwareSerial.h>
SoftwareSerial remoteSerial(2, 3); //Use pins 2 and 3 to connect the Serial connection
const int light = 13; //output and light
const int reedPin = 5; //read info from the Reed
int output = LOW;
View FrontdoorSensorPushover.ino
#include <SPI.h>
#include <Ethernet.h>
#include <HttpClient.h>
#include <SoftwareSerial.h>
// MAC address for your Ethernet shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// Pushover settings
char pushoversite[] = "";
View SwitchLightsRFLearning.ino
#include <RemoteSwitch.h>
#include <RemoteReceiver.h>
#include <Ethernet.h>
#include <SPI.h>
#include <WebServer.h>
#include <EEPROM.h>
#include <EEPROMAnything.h>
//Connections to the Arduino board
const int ledPin = 9;
View SwitchLightsGetRF.ino
#include <RemoteTransmitter.h>
#include <Ethernet.h>
#include <SPI.h>
#include <WebServer.h>
//Connections to the Arduino board
const int ledPin = 9;
const int transmitterPin = 8;
//Duration of a RF command
View JourneyExtractor.php
Journal (by Journey) extractor
Journey is a great Diary app for Android and Google Chrome. But, your files are
only accessible by Journey itself.
Do you want to move away from Journey to another diary app? Do you want to have
a readable export of your diary? This script converts Journey backup/export