Skip to content

Instantly share code, notes, and snippets.

View bastibe's full-sized avatar

Bastian Bechtold bastibe

View GitHub Profile
@bastibe
bastibe / fujifilm_auto_settings.lua
Last active April 10, 2022 09:39
Fujifilm Auto Settings Darktable Plugin
--[[ fujifilm_auto_settings-0.2
Apply Fujifilm film simulations, in-camera crop mode, and dynamic range.
Copyright (C) 2022 Bastian Bechtold <bastibe.dev@mailbox.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@bastibe
bastibe / ipython-matlab
Created March 13, 2017 15:23
IPython magic to call Matlab using Transplant
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__))+'/transplant')
from transplant_master import Matlab, TransplantError
from IPython.display import HTML, Image, display
from IPython import get_ipython
_matlab = Matlab()
def matlab(line, cell=None):
global _matlab
@bastibe
bastibe / cd.fish
Created January 23, 2017 15:08
A fish function to automatically activate a venv called ".env" in the current git root
#!/bin/env fish
function cd -d "change directory, and activate virtualenvs, if available"
# first and foremost, change directory
builtin cd $argv
# find a parent git directory
if git rev-parse --show-toplevel >/dev/null ^/dev/null
set gitdir (realpath (git rev-parse --show-toplevel))
else
@bastibe
bastibe / pulseaudio.py
Created April 11, 2016 08:27
A minimal CFFI interface to pulseaudio (pulse-simple)
import numpy
from cffi import FFI
ffi = FFI()
ffi.cdef("""
typedef enum pa_stream_direction {
PA_STREAM_NODIRECTION,
PA_STREAM_PLAYBACK,
PA_STREAM_RECORD,
PA_STREAM_UPLOAD
@bastibe
bastibe / download.bat
Created November 1, 2015 11:55
Scripts for automating G2XPL scenery downloads
C:\Users\Bastian\Miniconda3\python.exe download.py "poly files/na_ca_manitoba.poly"
C:\Users\Bastian\Miniconda3\python.exe download.py "poly files/na_ca_quebec.poly"
C:\Users\Bastian\Miniconda3\python.exe download.py "poly files/na_ca_newfoundland-and-labrador.poly"
pause
@bastibe
bastibe / limiter_python.py
Created October 11, 2015 10:58
A simple limiter in Python
# A simple limiter
from sounddevice import Stream, CallbackStop
from time import sleep
from numpy import array, random, zeros
import matplotlib.pyplot as plt
################################### Constants ##################################
fs = 44100 # Hz
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.