Skip to content

Instantly share code, notes, and snippets.

@nmandery
nmandery / solidtest.py
Created Nov 22, 2019
solidpython playground
View solidtest.py
import geojson
from euclid3 import Point3
from solid.utils import extrude_along_path
from solid import scad_render_to_file
def main():
# https://raw.githubusercontent.com/isellsoap/deutschlandGeoJSON/master/1_deutschland/4_niedrig.geojson
#fs = geojson.loads(open('4_niedrig.geojson').read())
#outline_d = fs[0]["geometry"]["coordinates"][0][0]
View eoc-bardabunga-volcano.markdown
View eoc-flood-using-wfs.markdown
View eoc-flood-using-wms-click.markdown
@nmandery
nmandery / make-git-changelog.sh
Last active Nov 29, 2016
generate a changelog from git tags
View make-git-changelog.sh
#!/bin/bash
# generate a changelog from git tags
TAGLIST=`git tag | grep -E '^v[0-9]+' | xargs -I@ git log --format=format:"%ai @%n" -1 @ | sort -r | awk '{print $4}'`
LAST_IN_LIST=HEAD
echo "Changelog"
echo "---------"
echo ""
@nmandery
nmandery / maildir2mailbox.py
Created Sep 25, 2015
Convert mails in maildir format to mailbox format
View maildir2mailbox.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
From http://stackoverflow.com/questions/2501182/convert-maildir-to-mbox
Frédéric Grosshans, 19 January 2012
Nathan R. Yergler, 6 June 2010
This file does not contain sufficient creative expression to invoke
assertion of copyright. No warranty is expressed or implied; use at
@nmandery
nmandery / dotfiles-install.playbook.yml
Last active Aug 29, 2015
Ansible playbook to install the dotfiles from github.com/nmandery/dotfiles
View dotfiles-install.playbook.yml
# vi: set ft=yml
---
- hosts: all
sudo: no
vars:
dotfiles_dir: "{{ansible_user_dir}}/.dotfiles"
handlers:
- name: purge cached system packages
shell: apt-get clean
@nmandery
nmandery / waitgroup.go
Created Jul 24, 2015
usage of golang sync.WaitGroup
View waitgroup.go
package main
import (
"fmt"
"sync"
"runtime"
)
func worker(id int, c chan int, wg *sync.WaitGroup) {
wg.Add(1)
@nmandery
nmandery / download_issuu_document.py
Created May 19, 2015
download the images of a document from issuu.com
View download_issuu_document.py
#!python
# encoding=utf8
# download the images of a document from issuu.com
import requests
import urlparse
import os
import os.path
# link to the jpg of the first page
@nmandery
nmandery / thinkpad_t420_samsung_syncmaster_205bw_modes.sh
Last active Aug 29, 2015
thinkpad_t420_samsung_syncmaster_205bw_modes.sh
View thinkpad_t420_samsung_syncmaster_205bw_modes.sh
# from https://wiki.archlinux.org/index.php/xrandr
# create modeline output based on the monitors resolution
cvt 1680 1050
# use that modeline for creating a new resolution
# also remove all non-resolution charaters from the mode
# name - otherwise arandr will crash
xrandr --newmode "1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync