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
# -*- coding: utf-8 -*- | |
''' | |
Django filters, needed when creating LaTeX files with the django template language | |
''' | |
from django.template.defaultfilters import stringfilter, register | |
from django.template.loader import render_to_string | |
@register.filter | |
@stringfilter | |
def brackets(value): |
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
# can be used to hide email addresses in the html source of Web sites from spiders | |
def html_encode(email): | |
''' | |
Takes a unicode string as only parameter and returns | |
a sequence of html encoded chars. | |
>>> html_encode(u"[email protected]") | |
'test@website.org' | |
''' |
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
% required packages | |
\usepackage{ifthen} | |
\usepackage{bbding} % for star symbols | |
% command for star printing | |
% \level{3} would print 3 stars | |
\newcounter{levelcounter} %init counter | |
\newcommand{\level}[1]{% | |
\ifthenelse{ \value{levelcounter}<#1 }% | |
{% |
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
# -*- coding: utf-8 -*- | |
''' | |
A very basic example for the Diffie–Hellman key exchange. | |
''' | |
class Machine(object): | |
''' | |
Represents a machine in the network | |
''' | |
def __init__(self, private_key, shared_keyset): |
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 | |
if [ $# == 1 ]; then | |
echo building pdf... | |
pdflatex $1.tex | |
biber $1 | |
makeindex $1.nlo -s nomencl.ist -o $1.nls | |
pdflatex $1.tex | |
pdflatex $1.tex |
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
ab -n10000 -c100 http://127.0.0.1:8080/index.html | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 1000 requests | |
Completed 2000 requests | |
Completed 3000 requests | |
Completed 4000 requests |
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/python | |
# -*- coding: <utf-8> -*- | |
import getopt | |
import sys | |
import urllib2 | |
from urllib2 import URLError, HTTPError | |
import base64 | |
import json | |
import getpass | |
from BeautifulSoup import BeautifulSoup, Tag |
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 python3 | |
# coding=utf-8 | |
import sys, getopt | |
def update_progress(progress, barLength = 12, status = ""): | |
'display a progress bar in the console and update in-place' | |
if isinstance(progress, int): | |
progress = float(progress) | |
if not isinstance(progress, float): | |
progress = 0 |
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 | |
# autodetect crop size | |
crop=`ffmpeg -i $1 -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print $NF }' | tail -1` | |
# cut string from "crop=1280:528:0:0" to "crop=1280:528" | |
crop=`echo "${crop%:*}"` | |
crop=`echo "${crop%:*}"` | |
echo "detected crop fromat: $crop" | |
echo "input: $1" | |
echo "output: $2" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer