Skip to content

Instantly share code, notes, and snippets.

@joemay
joemay / gist:5110152
Last active December 14, 2015 15:48 — forked from JeffreyWay/gist:5105516
Sublime Style Editor
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;font-size:16px}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/php");</script>
<?php
/**
* Simple wrapper around the
* PHPUnit assertion library.
*
* Assert::equals(21, $age);
* Assert::greaterThan(20, $age);
* Assert::has('Joe', ['John', 'Joe']);
*/
@joemay
joemay / gist:5229334
Created March 23, 2013 21:00 — forked from anonymous/gist:2871087
Terminal aliases
set -o vi
# Aliases
alias sites="cd ~/Sites/"
alias desk="cd ~/Desktop/"
alias ..="cd ../"
alias ...="cd ../../"
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
alias restartApache="sudo apachectl restart"
alias plugins="cd ~/.vim/bundle"
@mixin category-colors($after: false)
@each $category in $categories
@if $after == true
.cat-#{nth($category, 1)}:after
background-color: nth($category, 2)
@else
.cat-#{nth($category, 1)}
background-color: nth($category, 2)
property baseURL : "http://statusboard.dev/song?"
if application "Spotify" is running then
tell application "Spotify"
set theTrack to name of the current track
set theArtist to artist of the current track
set theAlbum to album of the current track
set theurl to spotify url of the current track
try
do shell script "/usr/local/bin/wget --delete-after \"" & baseURL & "&t=" & theTrack & "&a=" & theArtist & "&al=" & theAlbum & "\""
tell application "Messages"
log in service "<work-account1>"
log in service "<work-account2>"
end tell
tell application "Mail"
set enabled of account "<work-account>" to true
end tell
tell application "OmniFocus"
tell application "Messages"
log out service "<work-account1>"
log out service "<work-account2>"
end tell
tell application "Mail"
set enabled of account "<work-account>" to false
end tell
tell application "OmniFocus"
// bookmarklet template for Pinswift
// This can be copied into a bookmarklet maker like:
// http://chriszarate.github.io/bookmarkleter/
// Or used with Gruber's script
// http://daringfireball.net/2007/03/javascript_bookmarklet_builder
var href = location.href;
var path = 'pinswift://x-callback-url/add';
from flask import Flask, jsonify, request, Response, send_file
import youtube_dl
import eyed3
"""
Workflow script: https://workflow.is/workflows/7b80d0daa48847ff867882bed7df8032
Requires python installed with packages Flask, youtube_dl and eyed3 installed through pip
Required FFmpeg for mp3 conversion
"""
class SimpleYDL(youtube_dl.YoutubeDL):
def __init__(self, *args, **kargs):