This is no where near finished and does not follow REST standards.
To get a listing of all subjects you can simply hit http://api.kylestevenson.me/subjects
{
"subjects": [| function poke_user(profile_id) { | |
| try { | |
| params = { | |
| '__a': '1', | |
| 'uid': profile_id, | |
| 'ask_for_confirm': '0', | |
| 'pokeback': '0', | |
| '__asyncDialog': '1', | |
| 'nctr[_mod]': 'pagelet_timeline_profile_actions', | |
| 'fb_dtsg': 'AQCdeZ_I', |
| from bs4 import BeautifulSoup | |
| from requests import Session | |
| MAXMIND_URL = 'http://www.maxmind.com/en/locate_my_ip' | |
| def get_ip(sesh): | |
| soup = BeautifulSoup(sesh.get(MAXMIND_URL).content) | |
| return soup.find(id='my-ip-address').text |
| import random | |
| import re | |
| def word_stream(sentence): | |
| buff = '' | |
| for c in sentence: | |
| if 'A' <= c <= 'Z' or 'a' <= c <= 'z': | |
| buff += c | |
| else: | |
| if buff: |
| class Stack(object): | |
| def __init__(self): | |
| self.arr = [] | |
| def __len__(self): | |
| return len(self.arr) | |
| def push(self, obj): | |
| self.arr.append(obj) |
| class Cursor(object): | |
| def __init__(self): | |
| self.x, self.y = 0, 0 | |
| self.dirs = { | |
| 'd': (0, 1), | |
| 'u': (0, -1), | |
| 'r': (1, 0), | |
| 'l': (-1, 0) | |
| } |
| from libmproxy.script import concurrent | |
| @concurrent | |
| def request(context, flow): | |
| if 'user/ping' in flow.request.path: | |
| flow.request.content = '{"lat":44.563781,"lon":-123.279444}' # Oregon State |
| ➜ work radon cc -a ironic/ironic | tail -2 | |
| 2845 blocks (classes, functions, methods) analyzed. | |
| Average complexity: A (1.96379613357) | |
| ➜ work radon cc -a cloud-init/cloudinit | tail -2 | |
| 960 blocks (classes, functions, methods) analyzed. | |
| Average complexity: A (3.91145833333) | |
| ➜ work radon cc -a ironic-python-agent/ironic_python_agent | tail -2 | |
| 494 blocks (classes, functions, methods) analyzed. | |
| Average complexity: A (2.10526315789) |
| #!/bin/bash | |
| function get_clipboard_content { | |
| xclip -selection c -o | |
| } | |
| function upload_pastie { | |
| local lang="plain_text" | |
| local content=$(get_clipboard_content) | |
| local private=1 |
| import json | |
| import requests | |
| import sys | |
| COMPANY_TABLE_ID = 'company_table' | |
| URL_STACKALYTICS = 'http://stackalytics.com/api/1.0/stats' | |
| URL_SA_IRONIC_METRICS = '{}/{}?module={}&metric={}'.format( | |
| URL_STACKALYTICS, '{}', 'ironic-group', '{}') |