Skip to content

Instantly share code, notes, and snippets.

View ramboldio's full-sized avatar

Lukas Rambold ramboldio

View GitHub Profile
@ramboldio
ramboldio / helpers.jade
Last active June 13, 2016 12:41
Useful Jade code blocks
mixin windows-tile(image, color)
// Windows 8 tile icon
meta(name='msapplication-TileImage', content=image)
meta(name='msapplication-TileColor', content=color)
mixin fallback
<!--[if lt IE 7]><html class='no-js lt-ie9 lt-ie8 lt-ie7'> <![endif]-->
<!--[if IE 7]><html class='no-js lt-ie9 lt-ie8'> <![endif]-->
<!--[if IE 8]><html class='no-js lt-ie9'> <![endif]-->
@ramboldio
ramboldio / shaders.html
Last active November 8, 2022 12:45
Three.js / WebGL Custom texture shader
<script type="x-shader/x-vertex" id="vertexshader">
// switch on high precision floats
#ifdef GL_ES
precision highp float;
#endif
varying vec2 texcoord;
void main()
{
@ramboldio
ramboldio / mountBitLocker.sh
Created June 13, 2016 12:40
Mount Bitlocker HDD in Ubuntu
#!/bin/bash
sudo dislocker -V /dev/sdb1 -u /media/bitlocker/
sudo mount -rw -o loop /media/bitlocker/dislocker-file /media/mount/
sudo chmod +w /media/mount
nautilus /media/mount
@ramboldio
ramboldio / mysteryBox.ino
Created August 9, 2016 22:45
MysteryBox Arduino Sketch - Sketching with Hardware 2016 @ LMU
// libs import
#include <Adafruit_NeoPixel.h>
#include <Servo.h>
#define DEBOUNCE_COUNT 5
#define DURATION 650
#define PAUSE 150
#define SPEAKER_PIN 6
@ramboldio
ramboldio / gist:aeeeec64bfaca5a4e03cf5a8388cbe29
Created August 25, 2016 13:43
Copy YubiKey Auth OTP to clipboard
yubioath show Evernote | grep -oE "[0-9]{6}" | xclip -selection c
@ramboldio
ramboldio / docker-cleanup.sh
Created November 2, 2016 11:21
Cleanup old Docker Stuff on your machiene
# ~/.bash_aliases
# Kill all running containers.
alias dockerkillall='docker kill $(docker ps -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
alias dockercleani='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'
@ramboldio
ramboldio / config.py
Created November 28, 2016 11:24
Load .json server configuration sublime text style
# imports the settings from the config files
import json
"""
EXAMPLE:
.json
postgres {
database : ..
}
@ramboldio
ramboldio / docker-compose.yml
Created January 30, 2017 13:35
Dockerfile Django App
version: '2'
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password
volumes:
- ./dbdata:/var/lib/postgresql/data
@ramboldio
ramboldio / runCertbot.sh
Last active September 9, 2021 16:16
Run Certbot in Docker
#!/bin/bash
# this folder needs to exist
mkdir ~/certs
# authenticate yourself (requires that nothing runs on ports 443 and 80)
docker run --rm -it -v ~/certs:/etc/letsencrypt -p 443:443 certbot/certbot certonly --authenticator standalone
# renewal
docker run --rm -it -v ~/certs:/etc/letsencrypt certbot/certbot renew
@ramboldio
ramboldio / index.js
Created April 21, 2017 15:52
Reasonable d3.js (v4) update logic
_updated3 : function (canvas, data) {
// JOIN data to canvas and provide selection object
const circlesSelection = canvas.selectAll("circle").data(data);
// get circles which have to be added and subtracted
const circlesToAdd = circlesSelection.enter();
const circlesToRemove = circlesSelection.exit();
// create and delete svg object
const newCricles = circlesToAdd.append(d3.creator("circle"));