Skip to content

Instantly share code, notes, and snippets.

@jasimmk
jasimmk / bashprompt.sh
Created September 8, 2015 05:16
Bash coloring GIT, Virtualenv
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current Git, Mercurial or Subversion repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
#include "Python.h" // should be before any standard headers
#include <errno.h>
#include <pthread.h>
static void*
non_python_thread(void *python_callback) {
//XXX without PyEval_InitThreads() it produces:
// Fatal Python error: PyEval_SaveThread: NULL tstate
//XXX with PyEval_InitThreads() it deadlocks!!
//XXX without PyGILState_*() (with/without PyEval_InitThreads()) it produces:
@jasimmk
jasimmk / .gitmodules
Last active August 29, 2015 14:06
Git Submodule
# git submodule add https://github.com/mitsuhiko/flask-sphinx-themes.git flask-sphinx-theme
# git submodule add https://github.com/mitsuhiko/flask-sphinx-themes.git docs/_themes
[submodule "flask-sphinx-themes"]
path = flask-sphinx-themes
url = https://github.com/mitsuhiko/flask-sphinx-themes.git
[submodule "docs/_themes"]
path = docs/_themes
url = https://github.com/mitsuhiko/flask-sphinx-themes.git
@jasimmk
jasimmk / .gitattributes
Created September 19, 2014 06:43
Gitattribute file for deployement
# Defines files and directories that should not be deployed
.gitignore export-ignore
.gitattributes export-ignore
Gruntfile.js export-ignore
bower.json export-ignore
package.json export-ignore
README.md export-ignore
.bowerrc export-ignore
tests export-ignore
@jasimmk
jasimmk / .gitignore
Created September 19, 2014 06:41
Gitignore for Python WebDevelopment
# Boilerplate for .gitignore, Ignores unnecessary file extension/folders for python web development
# OS Stuff
.DS_Store
Thumbs.db
.sass-cache
*.*~
*.bak
@jasimmk
jasimmk / stripe_mock_api_generation_helper
Created June 11, 2014 08:37
Stripe save requests and responses to file, for mock api generation
import calendar
import datetime
import platform
import time
import urllib
import urlparse
import warnings
import stripe
from stripe import error, http_client, version, util
require 'formula'
class Boost < Formula
homepage 'http://www.boost.org'
url 'http://downloads.sourceforge.net/project/boost/boost/1.48.0/boost_1_48_0.tar.bz2'
md5 'd1e9a7a7f532bb031a3c175d86688d95'
head 'http://svn.boost.org/svn/boost/trunk', :using => :svn
# Bottle built on 10.7.2 using XCode 4.2
bottle 'https://downloads.sourceforge.net/project/machomebrew/Bottles/boost-1.48.0-bottle.tar.gz'