This file contains 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 unittest, os, os.path, sys, urllib | |
import tornado.database | |
import tornado.options | |
from tornado.options import options | |
from tornado.testing import AsyncHTTPTestCase | |
# add application root to sys.path | |
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
sys.path.append(os.path.join(APP_ROOT, '..')) |
This file contains 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/python -O | |
import numpy as np | |
from numpy import array | |
A, C, G, T = 0, 1, 2, 3 | |
int_to_char = {0:'A', 1:'C', 2:'G', 3:'T'} | |
#indel = -1 | |
#scoring = array([[1,-1,-1,-1], | |
#[-1,1,-1,-1], |
This file contains 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 tasks from Things to OmniFocus | |
-------------------------------------------------- | |
-------------------------------------------------- | |
-- | |
-- Script taken from: http://forums.omnigroup.com/showthread.php?t=14846&page=2 | |
-- Added: creation date, due date, start date functionality | |
-- Empty your Things Trash first. | |
-- Note that this won't move over scheduled recurring tasks. |
This file contains 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
tinymce.PluginManager.add('smartquotes', function(editor) { | |
function convert(e) { | |
rootNodes = editor.dom.select("body > *"); | |
for (var i = 0; i < rootNodes.length; i++) { | |
var el = rootNodes[i]; | |
var contentEditable = editor.dom.getAttrib(el, "contenteditable"); | |
if (contentEditable !== "false") { | |
convertBlock(el); |
This file contains 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
// https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd | |
export function closestElementComposed(selector, base = this) { | |
function __closestFrom(el) { | |
if (!el || el === document || el === window) return null; | |
let found = el.closest(selector); | |
return found ? found : __closestFrom(el.getRootNode().host); | |
} | |
return __closestFrom(base); | |
} |