Skip to content

Instantly share code, notes, and snippets.

apply plugin: 'groovy'
sourceCompatibility = 1.5
version = '0.1-SNAPSHOT'
repositories {
mavenRepo(urls: 'http://repository.codehaus.org/')
mavenCentral()
}
@fabiant7t
fabiant7t / s3_multipart_upload.py
Created April 17, 2011 14:54
Parallel S3 multipart upload with retries
import logging
import math
import mimetypes
from multiprocessing import Pool
import os
from boto.s3.connection import S3Connection
from filechunkio import FileChunkIO
@brianhsu
brianhsu / gist.py
Created November 30, 2011 02:49
[Python] reStructuredText GitHub Gist directive.
class GitHubGist(Directive):
""" Embed GitHub Gist.
Usage:
.. gist:: GIST_ID
"""
required_arguments = 1
optional_arguments = 1
@acdha
acdha / osx-keychain-via-security.py
Created February 9, 2012 20:50
Simple Python function for storing passwords in the Keychain portably
from subprocess import call, Popen, PIPE
from getpass import getpass
import sys
def keychain_wrapper(func):
@wraps(func)
def wrapper(service_name, username):
p = Popen(['security', 'find-internet-password', '-g', '-s', service_name, '-a', username],
shell=False, stdout=PIPE, stderr=PIPE)
rc = p.wait()
@mrabbitt
mrabbitt / get_keychain_pass.py
Created April 16, 2012 01:25
Command line access to the Mac OS X Keychain (based on post: http://blog.macromates.com/2006/keychain-access-from-shell/#comment-979)
#!/usr/bin/env python
import sys
import subprocess
import re
import logging
import argparse
# https://github.com/wooster/biplist (pip install biplist)
import biplist
@mrigor
mrigor / gist:2501863
Created April 26, 2012 18:46
git-svn patch to remember password in KeyChain on OS X (sudo vim /opt/local/libexec/git-core/git-svn)
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -5436,7 +5436,7 @@ BEGIN {
}
sub _auth_providers () {
- [
+ my @rv = (
SVN::Client::get_simple_provider(),
SVN::Client::get_ssl_server_trust_file_provider(),
@wutali
wutali / fabric.rb
Created July 10, 2012 12:30
Vagrant provisioner of Fabric.
module Vagrant
module Provisioners
class Fabric < Base
class Config < Vagrant::Config::Base
attr_accessor :fabfile_path
attr_accessor :fabric_path
attr_accessor :python_path
attr_writer :tasks
def _default_fabfile_path
# -*- mode: ruby -*-
# vi: set ft=ruby :
require "./fabric_provisioner.rb"
Vagrant::Config.run do |config|
# snip
config.vm.provision Vagrant::Provisioners::Fabric do |fab|
@omz
omz / New from Gist.py
Created November 15, 2012 04:52
New from Gist
### Based on: https://gist.github.com/b0644f5ed1d94bd32805
### This version strips unicode characters from the downloaded script
### to work around the currently limited unicode support of the editor
### module.
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
@pudquick
pudquick / shellista.py
Last active November 12, 2022 16:56
Advanced shell for Pythonista
import os, cmd, sys, re, glob, os.path, shutil, zipfile, tarfile, gzip
# Credits
#
# The python code here was written by pudquick@github
#
# License
#
# This code is released under a standard MIT license.
#