Skip to content

Instantly share code, notes, and snippets.

@dasevilla
dasevilla / github-issue-to-phab-task.py
Created May 6, 2014 23:01
Copy GitHub issues to Phabricator
import json
import os
import requests
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN')
if GITHUB_TOKEN is None:
raise Exception('Missing GITHUB_TOKEN from os.environ')
@dasevilla
dasevilla / evernote-gmail-bulk-import.js
Last active May 4, 2017 15:14
Google Apps Script to bulk-import Gmail messages into Evernote.
/**
* For every thread with the `Evernote` label:
* - Forward each message in the thread to your Evernote email address
* - Remove the Evernote label
*
* TODO: Figure out a way to trigger this script when a new thread is tagged, right now I run it manually.
*/
/**
* Your evernote Gmail label. Where the emails will be pulled from.
@dasevilla
dasevilla / rdio-catalog-match.py
Created January 10, 2014 00:42
Example of using The Echo Nest for bulk catalog matching to Rdio. This example depends on http://echonest.github.io/pyechonest/
import logging
import time
from pyechonest import config, catalog
config.ECHO_NEST_API_KEY = 'YOUR_API_KEY'
ECHO_NEST_SLEEP_LENGTH = 10 # seconds

While we prefer that everyone use the latest release:

http://www.rdio.com/media/static/developer/ios/rdio-ios.tar.gz

You can access previous releases:

http://www.rdio.com/media/static/developer/ios/releases/rdio-ios-1.0.tar.gz
http://www.rdio.com/media/static/developer/ios/releases/rdio-ios-1.1.tar.gz
http://www.rdio.com/media/static/developer/ios/releases/rdio-ios-1.2.tar.gz

http://www.rdio.com/media/static/developer/ios/releases/rdio-ios-1.3.0.tar.gz

@dasevilla
dasevilla / task-from-chrome.applescript
Created September 17, 2013 21:41
Create a task in Things from current Google Chrome tab
tell application "Google Chrome"
set theTab to active tab of first window
set theURL to the URL of theTab
set theTitle to the title of theTab
end tell
tell application "Things"
set newTodoName to "Review \"" & theTitle & "\""
set newTodo to make new to do at beginning of list "Inbox"
set name of newTodo to newTodoName
@dasevilla
dasevilla / daily-template.applescript
Last active December 18, 2015 01:59
AppleScripts to create a daily note.
-- The title will be today's date, it will be tagged with 'daily', and will be placed in the 'Inbox' notebook.
tell application "Evernote"
set theTitle to do shell script "date +%Y/%m/%d"
set theTags to {"daily"}
set theNotebook to "Inbox"
set theNote to create note with text "" title theTitle tags theTags notebook theNotebook
tell theNote to append html "<div><strong>Links</strong></div><div><ul><li>None</li></ul></div><div><hr /></div><div>Today</div>"
end tell
var url = 'https://services.rdio.com/api/1/';
var oReq = new XMLHttpRequest();
oReq.onload = function(e) {
if(oReq.readyState === 4) {
if(oReq.status === 200) {
var response = JSON.parse(oReq.responseText);
console.info(response);
} else {
console.error(oReq);
@dasevilla
dasevilla / desk-email-case-to-slack.json
Last active August 29, 2015 13:59
Send case notifications from Desk to Slack
{
"icon_url": "http://www.desk.com/resources/branding/desk-com-logo-mobile.png",
"attachments": [
{
"fields": [
{
"short": false,
"value": "{{case.customer.name}} {{case.customer.email}}",
"title": "From"
},
@dasevilla
dasevilla / gist:9837849
Created March 28, 2014 17:12
Start and pause a track at specific positions
R.player.on("change:position", function(newValue) {
console.log("the position is now " + newValue);
if (newValue == 30) {
R.player.pause();
}
});
R.player.play({
source: "t2866554",
initialPosition: 5
@dasevilla
dasevilla / station-embed.py
Created March 4, 2014 23:48
Given an artist short URL, print the artist station iframe URL. To be used with https://github.com/rdio/rdio-simple
#!/usr/bin/env python
from __future__ import unicode_literals
import sys,os.path
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from rdio import Rdio
from rdio_consumer_credentials import RDIO_CREDENTIALS
try: