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/bin/env python | |
import sys | |
from pyPdf import PdfFileWriter, PdfFileReader | |
from random import shuffle | |
import sha | |
import os | |
def random_reorder_pdf_file(fn): | |
fn_base, ext = os.path.splitext(fn) |
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
import base64 | |
import glob | |
import argparse | |
import os | |
# fmt_str = u"define(function(){{return 'data:{mimetype};base64,{content}';}});" | |
fmt_str = u'"data:{mimetype};base64,{content}"' | |
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
ko.bindingHandlers.modal = { | |
init: function(element, valueAccessor, allBindings, vm, context) { | |
var modal = valueAccessor(); | |
//init the modal and make sure that we clear the observable no matter how the modal is closed | |
$(element).modal({show: false}).on("hidden.bs.modal", function() { | |
if (ko.isWriteableObservable(modal)) { | |
modal(null); | |
} | |
}); |