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://notfaq.wordpress.com/2008/10/18/python-convert-string-to-htmlxml-entities/ | |
| def htmlentities(text): | |
| return ''.join(['&#%d;' % ord(ch) for ch in text]) |
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
| ls -l test1/* |awk '{print $9}' |xargs -i ln -s {} |
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
| # input.txt: blastlist format | |
| # https://github.com/jlhg/bdorpy/blob/master/docs/format/blastlist.txt | |
| awk -F'\t' '$1 ~ /^[0-9]/ { print $0 }' input.txt |sort -t$'\t' -k4d,4 -k18g,18 -k22gr,22 -k19gr,19 -k26gr,26 -k6gr |sort -t$'\t' -k4,4 -u >output.txt |
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/perl -w | |
| =begin | |
| cws2fws v 0.0.1 - Flash format 6+ decompressor | |
| Jose Melo de Assis Fonseca / JMAF | |
| http://zefonseca.com/ | |
| 2008-04-26 | |
| Usage: cws2fws <COMPRESSED_SWF_FILE.swf> |
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 | |
| class Empty(Exception): | |
| pass | |
| class ArrayStack: | |
| def __init__(self): |
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
| #!/bin/sh | |
| # Convert ANSI (terminal) colours and attributes to HTML | |
| # Licence: LGPLv2 | |
| # Author: | |
| # http://www.pixelbeat.org/docs/terminal_colours/ | |
| # Examples: | |
| # ls -l --color=always | ansi2html.sh > ls.html | |
| # git show --color | ansi2html.sh > last_change.html |
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
| unsigned long long | |
| choose(unsigned long long n, unsigned long long k) { | |
| if (k > n) { | |
| return 0; | |
| } | |
| unsigned long long r = 1; | |
| for (unsigned long long d = 1; d <= k; ++d) { | |
| r *= n--; | |
| r /= d; | |
| } |
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
| #include <stdio.h> | |
| #include <time.h> | |
| #include <stdlib.h> | |
| int main() | |
| { | |
| srand(time(NULL)); | |
| int r = rand(); | |
| printf("%d\n", r); |
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
| # Rollcode.com | |
| import sys, subprocess, urllib | |
| def getSpeech(phrase): | |
| googleAPIurl = "http://translate.google.com/translate_tts?tl=en&" | |
| param = {'q': phrase} | |
| data = urllib.urlencode(param) | |
| googleAPIurl += data # Append the parameters | |
| return googleAPIurl |
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
| #!/bin/bash | |
| # Usage: ./wmv2flv.sh <intput.wmv> <output.flv> | |
| if [ $# -eq 0 ]; then | |
| echo "Usage: ./wmv2flv.sh <intput.wmv> <output.flv>" | |
| exit 1 | |
| fi | |
| ffmpeg -i $1 -acodec libmp3lame -ar 22050 -ab 96000 -deinterlace \ | |
| -nr 500 -aspect 4:3 -r 20 -g 500 -me_range 20 -b 270k -deinterlace \ |