Skip to content

Instantly share code, notes, and snippets.

@miku
miku / pazpar2-curl.sh
Created May 8, 2018 13:46 — forked from ssp/pazpar2-curl.sh
curl commands for starting a pazpar2 session, searching and querying results
#!/usr/bin/env sh
curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=init&service=vlib" | grep init | sed -e 's/.*<session>//' | sed -e 's/<\/session>.*//' > /tmp/sessionID ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=search&query=gaga&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/sessionID`" ; curl "http://vlib.sub.uni-goettingen.de/pazpar2/search.pz2?command=show&session=`cat /tmp/se
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# -lt 1 ]; then
echo 'Usage: apt-rdepends-tree [-r] <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@miku
miku / pythononeliners.txt
Created April 13, 2018 16:38
python one liners!
Some useful Python one-liners taken from http://www.reddit.com/r/Python/comments/fofan/suggestion_for_a_python_blogger_figure_out_what/
All modules listed are part of the standard library and should work with Python 2.6+
How to use:
$ python -m [module] [arguments]
calendar - does default to displaying a yearly calendar, but it has a bunch of options (args are year or year month, options are HTML output, calendar locale, encoding, and some type-specific stuff, see python -m calendar -h)
cgi, dumps a bunch of information as HTML to stdout
@miku
miku / ProgrammaticNotebook.ipynb
Created March 3, 2018 15:28 — forked from fperez/ProgrammaticNotebook.ipynb
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@miku
miku / pyenv+virtualenv.md
Last active January 15, 2018 13:17 — forked from eliangcs/pyenv+virtualenv.md
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@miku
miku / gist:5cb6bc5c75eb772c944f15faf1755948
Created November 26, 2017 23:39 — forked from paulfryzel/gist:3947535
like gofmt but for c... and using astyle
#!/usr/bin/env bash
# mostly from http://word.bitly.com/post/31921713978/static-analysis
function cfmt {
if [[ $# -ne 1 ]]; then
echo "Usage: cfmt <file>"
else
astyle \
--style=1tbs \
--lineend=linux \
--convert-tabs \
model_G = nn.Sequential()
model_G:add(nn.JoinTable(2, 2))
model_G:add(cudnn.SpatialConvolutionUpsample(3+1, 64, 7, 7, 1, 1)):add(cudnn.ReLU(true))
model_G:add(nn.SpatialBatchNormalization(64, nil, nil, false))
model_G:add(cudnn.SpatialConvolutionUpsample(64, 368, 7, 7, 1, 4)):add(cudnn.ReLU(true))
model_G:add(nn.SpatialBatchNormalization(368, nil, nil, false))
model_G:add(nn.SpatialDropout(0.5))
model_G:add(cudnn.SpatialConvolutionUpsample(368, 128, 7, 7, 1, 4)):add(cudnn.ReLU(true))
model_G:add(nn.SpatialBatchNormalization(128, nil, nil, false))
model_G:add(nn.FeatureLPPooling(2,2,2,true))
@miku
miku / README.md
Created October 16, 2017 11:52 — forked from bnewbold/README.md
Broken python3 gluish TSV unicode

Do the whole thing:

PYTHONPATH='.' luigi --module small Small --local-scheduler
#!/usr/bin/env python
from sys import stdin, stdout
import csv
rdr = csv.reader(stdin, delimiter='\t')
wrt = csv.writer(stdout, delimiter='\t')
vals = []
rows = []
for row in rdr: