Skip to content

Instantly share code, notes, and snippets.

View kemitche's full-sized avatar

Keith Mitchell kemitche

View GitHub Profile
@kemitche
kemitche / reddit.pylintrc
Created September 4, 2012 21:58
pylintrc
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
@kemitche
kemitche / transifex.py
Created October 15, 2012 18:48
Transifex Timeline scraper
#!/usr/bin/python
import collections
import os
import sys
import time
from BeautifulSoup import BeautifulSoup
import requests
@kemitche
kemitche / send_trophy.py
Created October 15, 2012 20:53
i18n Trophy Giver
#!/usr/bin/python
import datetime
import os
import sys
import webbrowser
import requests
import transifex
In [3]: datetime.now() - datetime.now()
Out[3]: datetime.timedelta(-1, 86399, 999989)
In [4]: _.microseconds
Out[4]: 999989
@kemitche
kemitche / simple_app.py
Last active July 25, 2023 16:12
reddit OAuth 2.0 Python Webserver Example
#!/usr/bin/env python
from flask import Flask, abort, request
from uuid import uuid4
import requests
import requests.auth
import urllib
CLIENT_ID = None # Fill this in with your client ID
CLIENT_SECRET = None # Fill this in with your client secret
REDIRECT_URI = "http://localhost:65010/reddit_callback"
#!/bin/bash
if [ "$1" == "list" ]; then
if [ "$2" == "all" ]; then
sudo initctl list | grep reddit
else
sudo initctl list | grep reddit | grep 'start/running'
fi
exit;
fi
if [ "$1" == "shell" ]; then