Skip to content

Instantly share code, notes, and snippets.

@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@tbielawa
tbielawa / do_tags
Created March 1, 2011 01:20
a way to generate etags of all installed python libraries!!!
#!/bin/bash
# Originally written at: http://code.google.com/p/python-etags/
# You may need to augment your PYTHONPATH before this works.
#
# For example, for my locally checked out libraries:
# $ PYTHONPATH=/home/tbielawa/rhat/nushus/src/nushus_client
# $ PYTHONPATH=$PYTHONPATH:/home/tbielawa/rhat/nushus/src/nushus
# $ export PYTHONPATH
# $ do_tags
#
@laiso
laiso / hatenaoauth_example.py
Last active August 10, 2022 13:29
Pythonではてなの OAuth 対応 API を利用する
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
フレームワークとして Flask(http://flask.pocoo.org/) を、OAuth ライブラリとして oauth2(http://pypi.python.org/pypi/oauth2/) を利用したサンプルプログラムです。
下のコードを保存して (oauth_consumer.py とします)、YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET となっている部分を自分の consumer_key, consumer_secret で置き換えます。
$ python oauth_consumer.py
... で起動してから http://localhost:5000 に Web ブラウザでアクセスして下さい。