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 / 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 / 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"));
@ramboldio
ramboldio / forceUpdate.txt
Created May 24, 2017 15:36
Polymer 1.0 Forced property update
You need to import lodash which allows you to deep copy objects and arrays easily.
You can also write your own deep copy code of course. :D
JS
--------------------------------------------------
_forceUpdate : function(property)
// set a deep-copy of product as product
this.set(property, _.clone(this.get(property)));
### Keybase proof
I hereby claim:
* I am ramboldio on github.
* I am ramboldio (https://keybase.io/ramboldio) on keybase.
* I have a public key whose fingerprint is BEEA EE8C 9D7E 52E1 19B6 E936 D850 90BA 05BF 7AD0
To claim this, I am signing this object: