Skip to content

Instantly share code, notes, and snippets.

View Cabalist's full-sized avatar

Ryan Jarvis Cabalist

View GitHub Profile
/**
*
* Jquery Mapael - Dynamic maps jQuery plugin (based on raphael.js)
* Requires jQuery and raphael.js
*
* Map of Canadian Provinces
* Lambert Conformal conic projection
* @author Ryan Jarvis
* @source https://commons.wikimedia.org/wiki/File:Canada_blank_map.svg
from __future__ import print_function
with open("/Users/work/man_ls.txt") as a_man_page:
for each_line in a_man_page:
skip_next = False
underline = False
for each_char in each_line:
if skip_next and underline:
print(each_char, end="")
skip_next = False
undeline = False
@Cabalist
Cabalist / demo.py
Created November 20, 2011 19:09
Python LS request
import requests # http://python-requests.org
headers = {'User-Agent': "public.ID.here/1.0", 'X-PAPPID': "private-id-goes-here"}
r = requests.get('https://localhost:9630/api/invoices/', headers=headers, auth=("USERNAME", "PASSWORD"))
from BeautifulSoup import BeautifulStoneSoup as BSS
soup = BSS(r.content)
invoices = []
for x in soup.findAll('invoice'):
invoices.append(dict((t.name, t.text) for t in x.findAll(True)))