Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import re
import os
import csv
import glob
import string
from Tkinter import Tk
from cStringIO import StringIO
from tkFileDialog import askdirectory
# -*- coding: utf-8 -*-
import re
import os
import csv
import glob
import unicodedata as udata
from Tkinter import Tk
from cStringIO import StringIO
from tkFileDialog import askdirectory
@DrLulz
DrLulz / mdict.py
Created April 12, 2015 19:06
Parsing XML for Alfred
# encoding: utf-8
from __future__ import print_function, unicode_literals
from HTMLParser import HTMLParser
from urllib import quote
import sys
import hashlib
from xml.etree.cElementTree import fromstring as make_etree
@DrLulz
DrLulz / converted.csv
Created April 11, 2015 02:39
For Dr.Raymond
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 35 columns, instead of 16 in line 2.
V1,V2,V3,V7,V8,V9,V12,V14,V15,V16,V17,V18,V19,V20,V21,V22,V23,V24,V25,V26,V27,V29,V30,V31,V32,V34,V35,V36,V37,V40,V41,V42,V43,V49,V52
1234567,1111111-2222222,444444,Smith,James,M ,123 East Street,Somewhere,NC ,90210,2,,00:00.0,(752) 811-1234,(752) 811-1375,(752) 811-1379,[email protected],0,eng,White,Not Hispanic or Latino,3,3,SYSTEM,Healthy People Doctors,1000000000,NPI,Nurse,Practitioner,PA-C,1000000000,1000000000,PA-C,ATTENDING,"Patient words: The first line there is very useful for any script. It, defines a variable,that points, to the folder, containing the scriptThis is essential if your script needs other files that are located in the sameThe second line creates an array of file names that are required for the script to run properly. Weell use this, along with. /note/ for drainage: Another child at day care has pink eye . e_He has been smoking a crack pipe at night."
2345678,3333333-4444444,111111,Johnson,John,M ,1500 NW Ave,Boring,NC ,33304,1,,00:00.0,(157) 555-8167,(157) 836-8167,(150) 836-8
@DrLulz
DrLulz / quizlet-to-anki.py
Created March 24, 2015 18:55
Rip Quizlet cards into Anki from quizlet URL. In order to use you need modules BeautifulSoup and anki. The easiest way to get anki is to download the git and run the script from inside the folder.
import os
import urllib2
import datetime
import cStringIO
import ntpath
from bs4 import BeautifulSoup as bs
from anki import Collection as aopen
from operator import itemgetter
from PIL import Image
from random import randint
############################################################################################
# This script creates Anki decks from a web application.
# Designed specifically for usmle-rx.com flashfacts, but can be modified for any scenerio.
#
# Automation provided by /u/SYMPATHETIC_GANG_LION
# Anki import provided by /u/DrLulz
############################################################################################
import os
import sys
@DrLulz
DrLulz / anki_html.py
Last active October 2, 2024 22:01
Grab Q/A from HTML source and create Anki Cards directly.
#!/usr/local/bin/python
import os
import sys
import csv
from operator import itemgetter
from bs4 import BeautifulSoup
from anki import Collection as aopen
usmle_rx = open("/Users/drlulz/Desktop/test.html",'r').read()
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC>
<plist version="1.0">
<dict>
<key>author</key>
<string>jzelenkov</string>
<key>colorSpaceName</key>
<string>sRGB</string>
<key>gutterSettings</key>
<dict>
@DrLulz
DrLulz / Directions.md
Last active August 29, 2015 14:16
Bootstrap Carosel

Template:Slide

Minimal Call

{{slide|id=your_unique_id|img1=image.png|img2=image.png}}

Optional Parameters

Image Captions

SEMICOLON IS DELIMITER

<snippet>
<content><![CDATA[
{{tll
| title = ${1}
| subtitle = ${2}
| tip = ${3}
| body = ${4}
| icon = ${5}
| color = ${6}
}}