Skip to content

Instantly share code, notes, and snippets.

Mathias Perlet mperlet

Block or report user

Report or block mperlet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dj0001
dj0001 / dwdhue.bat
Last active Dec 14, 2018
weather warnings from DWD on philipshue
View dwdhue.bat
Rem DWD-Warnmodul (win10 1803), parameter addresse
@echo off
set lat=48.37& set lon=10.90
set /p lat="Enter lat(%lat%) " & set /p lon="Enter lon(%lon%) "
set bridge=http://localhost:8000/api/newdeveloper
if "%1"=="" (set /p bridge="change bridge adress(%bridge%) ") else (set bridge=%1)
set light=1
set /p light="select light(%light%) "
@duhaime
duhaime / measure_img_similarity.py
Last active Jan 20, 2020
Compare image similarity in Python using Structural Similarity, Pixel Comparisons, Wasserstein Distance (Earth Mover's Distance), and SIFT
View measure_img_similarity.py
import warnings
from skimage.measure import compare_ssim
from skimage.transform import resize
from scipy.stats import wasserstein_distance
from scipy.misc import imsave
from scipy.ndimage import imread
import numpy as np
import cv2
##
@cuixin
cuixin / json_to_map.go
Created Oct 25, 2017
json to map[string]interface{} example in golang
View json_to_map.go
package main
import (
"encoding/json"
"fmt"
)
func dumpMap(space string, m map[string]interface{}) {
for k, v := range m {
if mv, ok := v.(map[string]interface{}); ok {
@stefanmaric
stefanmaric / copy-to-clipboard-bookmarklet.md
Created Sep 7, 2016
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard
View copy-to-clipboard-bookmarklet.md

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@turtlemonvh
turtlemonvh / Caddyfile
Last active Dec 16, 2019
Multi-host wildcard caddy example
View Caddyfile
a.myhost.com {
tls off
root /var/www/
proxy / localhost:8091
log log/access.a.log
}
b.myhost.com {
tls off
root /var/www/
@trieloff
trieloff / README.md
Created Oct 24, 2015
A command line alternative to LampStealer
View README.md

The LampStealer app for Hue does not work with newer versions of the bridge, as the API has changed. This shell script works with fewer dependencies and achieves the same. Install jq and run the shell script after pushing the big button on the bridge.

@rozifus
rozifus / Python SimpleHTTPServer with SSL
Last active Feb 5, 2020
Python SimpleHTTPServer with SSL
View Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
@aras-p
aras-p / preprocessor_fun.h
Last active Feb 17, 2020
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@inflammable
inflammable / base58.js
Created Jun 14, 2012
Base58 (and other) Encoding and Decoding in Javascript
View base58.js
/*
* base58.js
* - encodes integers to and decodes from a base58 (or your own) base58 alphabet
* - based on Flickr's url shortening
*
* usage:
* base58.encode(integer);
* base58.decode(string);
*
* (c) 2012 inflammable/raromachine
You can’t perform that action at this time.