Skip to content

Instantly share code, notes, and snippets.

View swederik's full-sized avatar

Erik Ziegler swederik

  • Yunu
  • Rotterdam, The Netherlands
View GitHub Profile
From self[at]sungpae.com Mon Nov 8 16:59:48 2021
Date: Mon, 8 Nov 2021 16:59:48 -0600
From: Sung Pae <self[at]sungpae.com>
To: security@docker.com
Subject: Permissive forwarding rule leads to unintentional exposure of
containers to external hosts
Message-ID: <YYmr4l1isfH9VQCn@SHANGRILA>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature"; boundary="QR1yLfEBO/zgxYVA"
@swederik
swederik / tracks2prob.cpp
Created January 17, 2014 11:28
Total Track Length in MRtrix's tracks2prob.cpp
/*
Copyright 2010 Brain Research Institute, Melbourne, Australia
Written by Robert E. Smith and J-Donald Tournier, 14/07/10.
This file is part of MRtrix.
MRtrix 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 3 of the License, or
@breuderink
breuderink / brainvision.py
Created August 19, 2013 08:33
Python skeleton to read BrainVision EEG files.
# License: BSD 3-clause
# Author: Boris Reuderink
import logging, re, os.path, StringIO, itertools
from ConfigParser import SafeConfigParser
import numpy as np
# TODO:
# - add encoding of commas (\1)
# - verify units for resolution in UTF8
@adewes
adewes / generate_random_color.py
Last active March 26, 2024 08:18
A small Python script to generate random color sequences, e.g. for use in plotting. Just call the "generate_new_color(existing_colors,pastel_factor)" function to generate a random color that is (statistically) maximally different from all colors in "existing_colors". The "pastel_factor" parameter can be used to specify the "pasteliness"(?) of th…
import random
def get_random_color(pastel_factor = 0.5):
return [(x+pastel_factor)/(1.0+pastel_factor) for x in [random.uniform(0,1.0) for i in [1,2,3]]]
def color_distance(c1,c2):
return sum([abs(x[0]-x[1]) for x in zip(c1,c2)])
def generate_new_color(existing_colors,pastel_factor = 0.5):
max_distance = None
@paulkaplan
paulkaplan / gist:5770247
Last active October 12, 2021 01:43
Orbit Controls with momentum and damping for THREE.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
*
* customized for momentum (zoom and phi/delta) by paulkaplan
*/
THREE.OrbitControls = function ( object, domElement ) {
@tpoisot
tpoisot / qr.py
Created February 13, 2013 18:41
An a posteriori measure of network modularity -- code associated to the F1000R paper
import networkx as nx
import numpy as np
import scipy as sp
from scipy import stats
import matplotlib.pyplot as plt
import progressbar as pb # Get it from http://code.google.com/p/python-progressbar/
import community # Get it from http://perso.crans.org/aynaud/communities/
def nullModel(graph):
"""
@zeffii
zeffii / vertex_colour_remap.py
Created June 16, 2012 19:12
vertex_colors_bmesh_remapping_to_height
# vertex_color_from_z_height.py
import bpy
import random
from mathutils import Color, Vector
def remap(current, lower_old, upper_old, lower_new, upper_new):
'''
Remaps one range of values to another range of values, types must be float