Skip to content

Instantly share code, notes, and snippets.

@markpasc
markpasc / gist:9511836
Last active August 29, 2015 13:57
Postbox feature request
Hi! It would be a great feature if when an open message tab is closed by an
action (Archive, Delete), and a new message is selected in the Inbox tab, the
message is left unread until opened.
1. Enable “Automatically mark messages as read” in Preferences → Advanced →
General.
2. Turn off the Message Pane by unchecking the View → Show → Message Pane menu
option.
3. Go to the Inbox tab, with two or more consecutive messages unread.
4. Double-click the first message to open it in a new tab. The message is
@markpasc
markpasc / gist:5021252
Last active December 14, 2015 03:29
new “collection” command in https://github.com/markpasc/rdio-cli
$ bin/rdio collection --json collection.json
WARNING: Downloading collection of 674 albums (this will take a while)
100% |#########################################################################|
$ head collection.json
[
{
"albumKey": "a1522320",
"albumUrl": "/artist/alt-J/album/An_Awesome_Wave/",
"artist": "alt-J",
"artistKey": "rl1809209|67377",
@markpasc
markpasc / github_flask.py
Last active December 14, 2015 00:29 — forked from lrvick/github_flask.py
Flask app using GitHub API (without rauth, just requests)
from urllib import urlencode
from urlparse import parse_qsl
from flask import Flask, request, redirect, url_for
import requests
GITHUB_AUTHORIZE_URL = 'https://github.com/login/oauth/authorize'
GITHUB_ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token'
app = Flask(__name__)
@markpasc
markpasc / crossword.py
Last active December 12, 2015 08:49
regexp crossword solution checker
#!/usr/bin/env python
from itertools import izip, chain
import re
import sys
"""
Checks a solution to this regular expression crossword:
@markpasc
markpasc / git.txt
Created January 30, 2013 21:46
😕
markpasc@markpascbook:~/Work/project$ mate .git/config
markpasc@markpascbook:~/Work/project$ git branch --help
markpasc@markpascbook:~/Work/project$ git branch --set-upstream origin/master
The --set-upstream flag is deprecated and will be removed. Consider using --track or --set-upstream-to
Branch origin/master set up to track local branch master.
If you wanted to make 'master' track 'origin/master', do this:
git branch -d origin/master
git branch --set-upstream-to origin/master
@markpasc
markpasc / maf.py
Created October 9, 2012 16:30
download all the Make A Face faces
#!/usr/bin/env python
import codecs
from datetime import datetime
import logging
import json
import os
from os.path import isdir, join
from urllib import urlretrieve
@markpasc
markpasc / gist:3650653
Created September 6, 2012 03:20
Twitter Atom feeds are API results
$ curl -I https://twitter.com/statuses/user_timeline.atom?screen_name=markpasc
HTTP/1.1 200 OK
Date: Thu, 06 Sep 2012 03:17:59 GMT
Status: 200 OK
X-MID: 883d8e4575e5f12f60e1383bf38888728c981d7f
Content-Type: application/atom+xml; charset=utf-8
ETag: "1cd2a359db6ce15fc5e1c536b404d721"
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
X-RateLimit-Reset: 1346902028
@markpasc
markpasc / accounts.py
Created March 9, 2012 18:02
Pagination in the Recurly python client
import os
import recurly
from recurly import Account, PageError
recurly.API_KEY = os.environ['RECURLY_API_KEY']
def all_accounts():
accounts = Account.all()
@markpasc
markpasc / gist:1877033
Created February 21, 2012 15:31
kickstarter oembed broken
$ curl -i 'http://www.kickstarter.com/services/oembed?url=http%3A%2F%2Fwww.kickstarter.com%2Fprojects%2Fidlethumbs%2Fidle-thumbs-video-game-podcast'
HTTP/1.1 200 OK
Server: nginx/1.0.10
Date: Tue, 21 Feb 2012 15:30:27 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Status: 200 OK
Set-Cookie: abid=BAgiFWE2MDQwYTBhZTA3ODVmMjY%3D--7224c851a2fbb91c52ccc73ce8e4bee3ca5aa21d; path=/; expires=Sat, 21-Feb-2032 15:30:27 GMT
Set-Cookie: last_page=%2Fservices%2Foembed%3Furl%3Dhttp%253A%252F%252Fwww.kickstarter.com%252Fprojects%252Fidlethumbs%252Fidle-thumbs-video-game-podcast; path=/; expires=Tue, 21-Feb-2012 16:00:27 GMT
ETag: "7c4641f43a97f9019d313da5067eaf86"
@markpasc
markpasc / gist:1762659
Created February 7, 2012 22:48
pip installing riak (and protobuf 2.4.1)
Last login: Tue Feb 7 17:26:28 on ttys000
markpasc@markpascbook:~$ cd Work/
markpasc@markpascbook:~/Work$ mkdir riaktest
riaktest
markpasc@markpascbook:~/Work$ cd riaktest/
markpasc@markpascbook:~/Work/riaktest$ virtualenv env
New python executable in env/bin/python
Installing distribute....................................................................................................................................................................................done.
Installing pip...............done.
markpasc@markpascbook:~/Work/riaktest$ python --version