This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DropboxMixin(tornado.auth.OAuthMixin): | |
""" Dropbox OAuth authentication. | |
""" | |
_OAUTH_REQUEST_TOKEN_URL = "https://api.dropbox.com/1/oauth/request_token" | |
_OAUTH_ACCESS_TOKEN_URL = "https://api.dropbox.com/1/oauth/access_token" | |
_OAUTH_AUTHORIZE_URL = "https://www.dropbox.com/1/oauth/authorize" | |
_OAUTH_VERSION = "1.0" | |
_OAUTH_NO_CALLBACKS = False | |
def authorize_redirect(self, callback_uri=None, extra_params=None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; lp.el --- Launchpad API | |
;; Copyright (C) 2012 Adam Stokes | |
;; Author: Adam Stokes <[email protected]> | |
;; Keywords: api | |
;; Version: 1.0.0 | |
;; This file is free software; you can redistribute it and/or modify | |
;; it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ at 11:00pm | |
warning: commands will be executed using /bin/sh | |
at> do | |
at> cd / | |
at> /sbin/init 6 | |
at> done | |
at> <EOT> | |
$ at -l | |
2 Tue Apr 9 23:00:00 2013 a webguy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
missing status at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Kelp.pm line 195. | |
at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/Carp.pm line 100 | |
Carp::croak('missing status') called at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Plack/Response.pm line 87 | |
Plack::Response::finalize('Kelp::Response=HASH(0x44f8240)') called at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Kelp/Response.pm line 43 | |
Kelp::Response::finalize('Kelp::Response=HASH(0x44f8240)') called at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Kelp.pm line 195 | |
Kelp::psgi('Bastille::BMS=HASH(0x2f0b718)', 'HASH(0x4845910)') called at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Kelp.pm line 99 | |
Kelp::__ANON__('HASH(0x4845910)') called at /home/zef/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/Plack/Middleware/Static.pm line 18 | |
Plack::Middleware::Static::call('Plack::Middleware::Static=HASH(0x420c148)', 'HASH(0x4845910)') called at /h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all = myserver.INBOX:select_all() | |
spam = Set {} | |
unsure = Set {} | |
for _, mesg in ipairs(all) do | |
mbox, uid = unpack(mesg) | |
text = mbox[uid]:fetch_message() | |
flag = pipe_to('bogofilter', text) | |
if (flag == 0) then | |
table.insert(spam, mesg) | |
elseif (flag == 2) then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from subprocess import Popen, PIPE, STDOUT | |
def is_executable(command): | |
"""Returns if a command matches an executable on the PATH""" | |
paths = os.environ.get("PATH", "").split(os.path.pathsep) | |
candidates = [command] + [os.path.join(p, command) for p in paths] | |
return any(os.access(path, os.X_OK) for path in can |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import apt_pkg | |
def packages(): | |
""" Generator that returns all packages found on system | |
""" | |
apt_pkg.init_config() | |
apt_pkg.init_system() | |
package_cache = apt_pkg.Cache() | |
for package in package_cache.packages: | |
if package.current_state is apt_pkg.CURSTATE_INSTALLED: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
set background=dark | |
colorscheme jellybeans | |
set textwidth=79 | |
set formatoptions=qrn1 | |
if exists('+colorcolumn') | |
set colorcolumn=80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unicodedata | |
import hashlib | |
import re | |
import datetime | |
import calendar | |
import tornado.web | |
import markdown2 | |
from bs4 import BeautifulSoup | |
from pygments import highlight | |
from pygments.lexers import get_lexer_by_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* requires adobe source code pro and droid sans font installed on your system | |
* covers *.github.com including gists. | |
*/ | |
body { font-family: 'Droid Sans', 'Ubuntu', sans-serif; } | |
tt,pre,code { font-family: 'Source Code Pro'; } | |
.file-data pre { font-family: 'Source Code Pro'; } |
OlderNewer