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
// 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 |
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 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: |
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
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 |
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
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. | |
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 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) | |
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
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'); |
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
#contributor : Zachary Voase <[email protected]> | |
#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" /> |
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
#!/bin/bash | |
# djcontribunlink.sh - Remove a djcontriblinked module from the Django contrib directory. | |
# See http://gist.github.com/42768 for updates. | |
# You may also want to see djcontriblink at http://gist.github.com/42767. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then | |
echo "Usage: `basename $0` <link_name>" |
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
#!/bin/bash | |
# | |
# djcontriblink.sh - Link a Python module (usually a Django app) to the Django contrib directory. | |
# Note: this approach to installing Django apps is not recommended, but some apps require it. | |
# | |
# See http://gist.github.com/42767 for updates. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then |
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/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 |
NewerOlder