This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/967815/how-do-you-fade-in-out-a-background-color-using-jquery | |
//Color row background in HSL space (easier to manipulate fading) | |
$('tr').eq(1).css('backgroundColor','hsl(0,100%,50%'); | |
var d = 1000; | |
for(var i=50; i<=100; i=i+0.1){ //i represents the lightness | |
d += 10; | |
(function(ii,dd){ | |
setTimeout(function(){ | |
$('tr').eq(1).css('backgroundColor','hsl(0,100%,'+ii+'%)'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################ | |
# This script creates Anki decks from a web application. | |
# DrLulz Mar-2016 | |
############################################################################################ | |
class IM: | |
import os, sys, wget, ntpath, unicodedata, codecs, linecache, time | |
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.common.by import By |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Locating UI elements ### | |
# By ID | |
<div id="coolestWidgetEvah">...</div> | |
element = driver.find_element_by_id("coolestWidgetEvah") | |
or | |
from selenium.webdriver.common.by import By | |
element = driver.find_element(by=By.ID, value="coolestWidgetEvah") | |
# By class name: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################ | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function file_exists(playlist) | |
local f=io.open(playlist, "r") | |
if f~=nil then io.close(f) return true else return false end | |
end | |
function entry_complete(playlist) | |
local f=io.open(playlist, "r") | |
chars = f:read("*all") | |
last_char = string.sub(chars, -1) | |
if last_char == ";" then io.close(f) return true else return false end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ZOOM | |
function zoom_in() | |
zoom = mp.get_property("video-zoom") | |
zoom_to = zoom + 0.1 | |
mp.set_property("video-zoom", zoom_to) | |
end | |
function zoom_out() | |
zoom = mp.get_property("video-zoom") | |
zoom_to = zoom - 0.1 | |
mp.set_property("video-zoom", zoom_to) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import os | |
import csv | |
import sys | |
import glob | |
import string | |
import linecache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
import os | |
import csv | |
import glob | |
import string | |
from Tkinter import Tk | |
import unicodedata as udata | |
from cStringIO import StringIO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import os | |
import csv | |
import sys | |
import glob | |
import string | |
import linecache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- cards are what you review. easy! | |
CREATE TABLE cards ( | |
id integer primary key, | |
-- the epoch milliseconds of when the card was created | |
nid integer not null, | |
-- notes.id | |
did integer not null, | |
-- deck id (available in col table) | |
ord integer not null, | |
-- ordinal, seems like. for when a model has multiple templates, or thereabouts |