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
<syntaxColor id="CodeColor_DjangoTemplateFilter" text="#5C4B5E" /> | |
<syntaxColor id="CodeColor_DjangoTemplateTag" text="#5C4B5E" /> | |
<syntaxColor id="CodeColor_DjangoTemplateBlockTag" text="#999999" bold="true" /> | |
<syntaxColor id="CodeColor_DjangoTemplateVariable" text="#999999" bold="true" /> | |
<syntaxColor id="CodeColor_DjangoTemplateString" text="#99CC66" /> | |
<syntaxColor id="CodeColor_DjangoTemplateIdentifier" text="#B8A484" /> | |
<syntaxColor id="CodeColor_DjangoTemplateOperator" text="#993333" /> | |
<syntaxColor id="CodeColor_DjangoTemplateNumbers" text="#993333" /> |
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 csv | |
from github2.client import Github | |
# api settings for github | |
git_username = 'your_git_username' | |
git_api_token = 'your_git_api_token' | |
git_repo = 'username/repo_name' | |
# import all issues as this story type | |
pivotal_story_type = 'Bug' |
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 logging | |
import sys | |
import time | |
from threading import Thread | |
from Queue import Queue | |
from django.conf import settings | |
from django.core.exceptions import ImproperlyConfigured | |
from django.db.models.loading import get_model | |
from haystack.backends import BaseSearchBackend, BaseSearchQuery, log_query, EmptyResults | |
from haystack.constants import ID, DJANGO_CT, DJANGO_ID |
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 requestbin.web import app | |
from requestbin.service import RequestBin | |
from requestbin.storage.memory import MemoryStorage | |
request_bin = RequestBin() | |
request_bin.do_start() | |
app.config['bind_address'] = ('0.0.0.0', int(os.environ.get("PORT", 5000))) |
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
#!/bin/bash | |
# Try and get debian operating system | |
# id, codename, and release | |
get_debian_os_meta() { | |
OS=$(uname) | |
ID="unknown" | |
CODENAME="unknown" | |
RELEASE="unknown" |
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
#!/usr/bin/env python | |
""" | |
OSX ONLY! | |
Monitor OSX application usage from your shell | |
and at the end of the day see how much you don't | |
work ;) | |
Author: Glen Zangirolami | |
http://theglenbot.com |
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
#!/bin/bash | |
# Configuration files | |
TEMP_CONFIG="/tmp/gitswitchrc" | |
ALT_SSH_CONF="$HOME/.ssh/id_rsa_gitswitch" | |
BASHRC="$HOME/.bashrc" | |
# PS1 prompt pre-text | |
# Places some text behind your command prompt to give | |
# a context clue that you are within another GIT context. |
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
#!/usr/bin/env python | |
# Due Date Notifier - Notify VIA SMS (SendHub) when a bill is going to be due | |
# * Requires a SendHub account (free) - http://sendhub.com | |
# * Has python package dependencies: simplejson, requests | |
# * Recommend putting this on a crob job running once a day | |
# I like my text messages at at 11am | |
# | |
# NOTE: Sendhub free accounts allow only 500 requests to the API per month. | |
# This should suffice assuming the amount of bills you pay arent loco. | |
# |
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
""" | |
Demonstration of ways to implement this API: | |
sanitize(user_input, stop_words) | |
Related discussions: | |
- Modifying a list while looping over it: | |
- http://stackoverflow.com/questions/1207406/remove-items-from-a-list-while-iterating-in-python | |
- Remove all occurences of a value in a list: | |
- http://stackoverflow.com/questions/1157106/remove-all-occurences-of-a-value-from-a-python-list |
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
#!/usr/bin/env python | |
""" | |
Stress test a web site | |
Usage: | |
stress_test_replay [options] | |
Options: | |
--host=<host> The host to connect to [default: http://www.example.com]. |
OlderNewer