aspe:keyoxide.org:SANRZ2DWCGCATM22OQ26RWURBI
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 -*- | |
''' | |
Script to reduce the size of a pdf, handy for emailing to collaborators | |
Based on command found on http://www.ehow.com/how_6823473_reduce-pdf-file-size- | |
linux.html | |
First version 22.01.2013, David Haberthür | |
Second version 07.05.2013, David Haberthür: Cleanup | |
''' |
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
cd | |
date | |
# Mon Mar 10 08:33:45 AM CET 2025 | |
cd Dev/ | |
mkdir deutschland-bahnhofstrassen | |
cd deutschland-bahnhofstrassen/ | |
cargo install osm-lump-ways | |
wget https://download.geofabrik.de/europe/germany-latest.osm.pbf | |
osm-lump-ways -i germany-latest.osm.pbf -f highway -f highway≠pedestrian -f name~"ahnhofs" -o de-bahnhof.geojson | |
date |
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
def centralizeslice(image, threshold=None, verbose=False): | |
''' | |
Move detected region centroid to center of image | |
This function can successively be applied to 'verticalize' slices of a tomographic dataset of a cylindrical object not scanned perfectly vertical | |
''' | |
if not threshold: | |
print('Calculating threshold') | |
threshold = skimage.filters.threshold_otsu(image) | |
label_img = skimage.measure.label(image > threshold) | |
# Detect centroid |
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
# CDDB options | |
CDDBMETHOD=cddb,musicbrainz | |
CDDBURL="http://gnudb.gnudb.org/~cddb/cddb.cgi" | |
CDDBSUBMIT=freedb-submit@freedb.org | |
CDDBPROTO=6 | |
HELLOINFO="$(whoami)@$(hostname)" | |
# The following options control whether or not fetched CDDB entries | |
# are cached locally in $CDDBLOCALDIR |
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
for i in *.ipynb | |
# Tell us what we are doing | |
do echo Checking $i | |
# Convert the Jupyter notebook to .py and run through pycodestyle | |
jupyter nbconvert $i --to script && pycodestyle *.py --ignore=E501,E402,W391,W503 --show-source; | |
# Remove the converted file, thanks to https://stackoverflow.com/a/12152997 | |
echo Removing "${i%.*}.py" | |
rm "${i%.*}.py" | |
done |
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
def ourarrow(x, y, linestyle='solid', yaw='left', pitch='up', color='white'): | |
# usually, the arrow points to the left | |
horizontaldisplacement = 75 | |
verticaldisplacement = horizontaldisplacement | |
if 'right' in yaw: | |
horizontaldisplacement = horizontaldisplacement * -1 | |
if 'down' in pitch: | |
verticaldisplacement = verticaldisplacement * -1 | |
plt.gca().annotate('', xy=(x, y), | |
xytext=(x + horizontaldisplacement, y + verticaldisplacement), |
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
def orthoslicer(stack, direction, coordinates, verbose=False): | |
'''Works like "orthogonal view" (CTRL+Shift+H in ImageJ''' | |
if verbose: | |
print('The input stack has a size of %s x %s x %s px' % (stack.shape[0], | |
stack.shape[1], | |
stack.shape[2])) | |
print('Extracting a slice centered %s, %s, %s px in direction %s' % (coordinates[0], | |
coordinates[1], | |
coordinates[2], | |
direction)) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<!-- OPML generated by Fever --> | |
<head><title>Fever</title></head> | |
<body> | |
<outline text="Kindling"> | |
<outline type="rss" text="www.woz.ch/taeglich/feed" title="www.woz.ch/taeglich/feed" xmlUrl="www.woz.ch/taeglich/feed" htmlUrl=""/> | |
<outline type="rss" text="500 Internal Server Error" title="500 Internal Server Error" xmlUrl="https://www.biorxiv.org/alerts?destination=alerts/search/add&search_query=haberth%25C3%25BCr" htmlUrl="https://www.biorxiv.org/alerts?destination=alerts/search/add&search_query=haberth%25C3%25BCr"/> | |
<outline type="rss" text="Andrew Janowczyk" title="Andrew Janowczyk" xmlUrl="http://www.andrewjanowczyk.com/feed" htmlUrl="https://andrewjanowczyk.com"/> | |
<outline type="rss" text="Arq Backup Blog" title="Arq Backup Blog" xmlUrl="https://www.arqbackup.com/blog/feed" htmlUrl="https://www.arqbackup.com/blog"/> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder