Skip to content

Instantly share code, notes, and snippets.

View simonhaenisch's full-sized avatar
💪
Staying fefeka.

Simon Hänisch simonhaenisch

💪
Staying fefeka.
View GitHub Profile
@simonhaenisch
simonhaenisch / install-opencv3-macos.sh
Last active February 14, 2018 23:33
OpenCV 3 macOS
#! /bin/bash
# tap science
brew tap homebrew/science
# install python 3
brew install python3
# install opencv 3 with python 3 bindings
brew install opencv3 --HEAD --with-python3 --without-test
@simonhaenisch
simonhaenisch / convert-vid-for-web.sh
Last active October 4, 2017 01:59
Convert videos to H.264 for web
#! /bin/bash
# https://trac.ffmpeg.org/wiki/Encode/H.264
# https://app.zencoder.com/docs/guides/encoding-settings/h264-advanced
# get input and output filenames from cl args
i="$1"
o="$2"
# run ffmpeg
@simonhaenisch
simonhaenisch / remove-dot-from-dotfiles.sh
Last active January 1, 2019 04:03
remove dot from dotfiles
#! /bin/zsh
setopt dotglob
for f in *; do mv "$f" "${f:1}"; done
unsetopt dotglob
@simonhaenisch
simonhaenisch / Material-Theme-Darker.sublime-theme
Last active February 15, 2018 00:50
ST Material Theme: overwrite accent color in minimap viewport #sublimetext
// place this in Packages/User to load the default theme but then overwrite the `minimap_control` class
[
{
"class": "minimap_control",
"viewport_color": [255, 255, 255, 30],
"viewport_opacity": 0.5,
}
]
@simonhaenisch
simonhaenisch / better-sublime-icon.sh
Last active February 15, 2018 00:50
better sublime text icon (macOS) #sublimetext
git clone https://github.com/YabataDesign/sublime-text-icon.git
cp sublime-text-icon/Sublime\ Text.icns ~/Downloads
cp -f ~/Downloads/Sublime\ Text.icns /Applications/Sublime\ Text.app/Contents/Resources/
rm -rf sublime-text-icon
# then copy-paste or drag-n-drop the icon in "Downloads" into the file info of the app
# single line:
git clone https://github.com/evansendra/sublime-text-icon.git && cp sublime-text-icon/Sublime\ Text.icns ~/Downloads && cp -f ~/Downloads/Sublime\ Text.icns /Applications/Sublime\ Text.app/Contents/Resources/ && rm -rf sublime-text-icon
@simonhaenisch
simonhaenisch / rpi-osmc-and-shairport.md
Last active February 15, 2018 00:50
RPi: OSMC & shairport-sync #raspberrypi

Raspberry Pi with OSMC and shairport-sync

It is assumed that OSMC is installed and running on the Raspberry, and the Airport service should be disabled (though it doesn't have to be, but who needs two Airplay services). OSMC is based on Debian 8 (Jessie).


If you get Error opening terminal when opening nano or alsamixer, update the current TERM:

export TERM=xterm
@simonhaenisch
simonhaenisch / 1.subl-build-system-capture.js
Last active February 15, 2018 00:51
Sublime Text 3: Capturing Build System Results (example for Visual Studio/MSBuild output) #sublimetext
{
"build_systems":
[
{
"name": "build system one",
"working_dir": "$project_path/code",
"cmd":
[
"msbuild",
"/path/to/solution.sln",
@simonhaenisch
simonhaenisch / selector-based-hotkey.json
Last active February 15, 2018 00:51
Sublime Text hotkey that triggers only when in a certain syntax #sublimetext
[
{
"keys": ["f8"],
"command": "repl_open",
"args": {
"cmd": ["python", "-u", "$file_basename"],
"cwd": "$file_path",
"encoding": "utf8",
"extend_env": {"PYTHONIOENCODING": "utf-8"},
"external_id": "python",
@simonhaenisch
simonhaenisch / build-scss.js
Created August 20, 2016 10:36
Build SCSS with the `node-sass` npm module
// npm install node-sass
var fs = require('fs'),
sass = require('node-sass');
// specify in-/output files
var inFile = '/path/to/main.scss',
outFile = '/path/to/main.css';
sass.render(
@simonhaenisch
simonhaenisch / ssl-encrypt-decrypt.sh
Last active August 20, 2016 08:51
OpenSSL file en-/decryption
#! /bin/bash
file="path/to/file.txt"
# encrypt
openssl enc -aes-256-cbc -e -in "$file" -out "${file}_encrypted" -pass pass:<password>
# decrypt
openssl enc -aes-256-cbc -d -in "$file" -out "${file}_decrypted" -pass pass:<password>