Skip to content

Instantly share code, notes, and snippets.

// Jash - JavaScript Shell
// Copyright: 2007, Billy Reisinger
// Documentation: http://www.billyreisinger.com/jash/
// License: GNU General Public License - http://www.gnu.org/licenses/gpl.html
function Jash(){this.jashRoot="http://www.billyreisinger.com/jash/source/latest/";this.domGetElFunctions={id:new Array("document.getElementById","$"),className:new Array("getElementsByClassName","$C")};var line="-------------------------------------------------";var _null="nooutput";this.revision="$Revision: 1.11 $".replace(/(\$|[A-Za-z]|\s|:)/g,'');this.version="$Name: REL_1_35_4 $".replace(/\$|Name:|\s|REL_/g,'').replace(/_/g,'.');this.versionDate="$Date: 2007/07/13 04:40:03 $";this.main=function(){this.browser=this.returnBrowserType();this.lineNumber=0;this.mainBlock;this.output=document.getElementById("JashOutput");this.input;this.outputHistory=new Array();this.cssEvalFlag=false;this.innerHtmlInspection=false;this.accessKeyText=this.getAccessKeyText();this.defaultText="Jash, v"+this.version+"\nEnter \"jash.h
import os
def import_all_from(module_name, globals_):
# Calling it with the globals_ module provides a hook into the
# module-level globals; otherwise we'd get the function's globals
# (which might be different).
module_split = module_name.split('.')
while '__init__' in module_split:
module_split.remove('__init__')
while '__main__' in module_split:
class CallSuper(Exception): pass
def callsuper(method):
"""
Decorator for calling the super method automagically.
In the submethod, if a ``CallSuper`` exception is raised at any point, then
the wrapper will look up the class's MRO (method resolution order) for a
method of the same name. If none is found, the exception is allowed to
There are two main issues with this at the moment:
1. The 'Backtrace' section is going to look a little odd, because Ruby formats
it with the most recent call *first*, whereas Python uses most recent call
*last*. This could be solved, but I haven't done it yet (it's probably
quite easy).
2. The 'Environment' section's going to look a little weird, because I don't
know what should go there. Suggestions are very much welcome.
import fileinput
import sys
from Bio.ExPASy import get_sprot_raw
from Bio.SeqIO import parse
from Bio.SeqIO.FastaIO import FastaWriter
fasta_out = FastaWriter(sys.stdout,
record2title=lambda record: record.id)
function add_script (url) {
head = document.getElementsByTagName('head')[0];
script = document.createElement('script');
script.src = url;
script.type = 'text/javascript';
head.appendChild(script);
return script;
}
add_script('http://www.billyreisinger.com/jash/source/latest/Jash.js');
add_script('http://google.com/jsapi');
#contributor : Zachary Voase <zack@biga.mp>
#name : Complete XHTML 1.1 Document
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}">
<head>
<title>${2:Title}</title>
<!-- meta tags -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css; charset=UTF-8" />
@zvoase
zvoase / djcontribunlink.sh
Created January 3, 2009 01:58
djcontribunlink.sh - Remove a djcontriblinked module from the Django contrib directory.
@zvoase
zvoase / djcontriblink.sh
Created January 3, 2009 01:51
djcontriblink - Link and unlink Python modules (usually Django apps) to the Django contrib directory.
#!/usr/bin/env python
#
# Run it like this:
# $ aescrypt <filename> => this will encrypt <filename> to <filename>.secret
# $ aescrypt <filename.secret> => this will decrypt to <filename>
#
import getpass
import hashlib
import math