Skip to content

Instantly share code, notes, and snippets.

Ryan Jarvis Cabalist

View GitHub Profile
View canada.js
/**
*
* 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
View convert_bold_man_page.py
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 Nov 20, 2011
Python LS request
View demo.py
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)))
You can’t perform that action at this time.