This file contains hidden or 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
| # Credit http://stackoverflow.com/a/2514279 | |
| for branch in `git branch --no-merged`;do echo -e `git show --abbrev-commit --format="%ci %d %s" $branch | head -n 1`; done | sort -r |
This file contains hidden or 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
| for i in `hg branches |grep -v 'default' |grep -v 'production' |grep inactive |awk '{print $1}'`; do hg update $i && hg commit -m "close branch" --close-branch; done |
This file contains hidden or 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/sh | |
| /usr/bin/awk ' | |
| BEGIN { | |
| FS="\t"; | |
| FIELD_NAME="'$1'"; | |
| print FIELD_NAME; | |
| } | |
| NR == 1 { |
This file contains hidden or 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
| from pprint import pprint | |
| import re | |
| from django.conf import settings | |
| from django.contrib.auth.models import User, check_password | |
| from django.contrib.auth import authenticate, login | |
| from apps.api.authentication import verify_access_token, OAuthError | |
| class OAuth2Middleware( object ): |
This file contains hidden or 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 | |
| import sys | |
| import re | |
| from django.utils import translation | |
| from django.middleware.locale import LocaleMiddleware | |
| class LocaleNoHTTPAcceptMiddleware(LocaleMiddleware): | |
| def process_request(self, request): | |
| request.LANGUAGE_CODE = translation.get_language() |
This file contains hidden or 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
| // ==UserScript== | |
| // @name HNBitcoinHider | |
| // @namespace http://yerb.net/ | |
| // @version 0.1 | |
| // @description Hide bitcoin news items on Hacker News | |
| // @match https://news.ycombinator.com* | |
| // @copyright 2013, Breyten Ernsting | |
| // @require http://code.jquery.com/jquery-latest.js | |
| // ==/UserScript== |
This file contains hidden or 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
| // ==UserScript== | |
| // @name GithubNewIssueDefaults | |
| // @namespace http://yerb.net/ | |
| // @version 0.1 | |
| // @description Make a new issue have sane defaults -- milestone & assignee | |
| // @match https://github.com/*/*/issues/new | |
| // @copyright 2013, Breyten Ernsting | |
| // @require http://code.jquery.com/jquery-latest.js | |
| // ==/UserScript== |
This file contains hidden or 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 | |
| import requests | |
| from BeautifulSoup import BeautifulSoup | |
| def get_politicians(session): | |
| url = u'http://www.tweedekamer.nl/kamerleden/alle_kamerleden' | |
| resp = session.get(url) | |
| if resp.status_code != 200: | |
| return None |
This file contains hidden or 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 | |
| import requests | |
| from BeautifulSoup import BeautifulSoup | |
| NPO_BACKSTAGE_BASE_URL = 'http://backstage-api.npo.nl' | |
| NPO_BACKSTAGE_ENDPOINT_SEARCH = '/v0/search' | |
| def get_politician_count(politician, session): | |
| SEARCH_DATA = { |
This file contains hidden or 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
| party_counts = sorted([ | |
| {'party': p, 'count': get_party_count(p, session)} for p in parties], | |
| key=lambda x: x['count']) | |
| pprint(party_counts) | |
| all_people = politicians + executives | |
| politician_counts = sorted([ | |
| {'politician': p, 'count': get_politician_count(p, session)} for p in all_people], | |
| key=lambda x: x['count']) |
OlderNewer