This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# C-b is not acceptable -- Vim uses it | |
set-option -g prefix C-a | |
bind-key C-a last-window | |
# Start numbering at 1 | |
set -g base-index 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec2 hash_2d(vec2 v) | |
{ | |
float angle = 3.14/8.0; // 22.5° clockwise | |
// Do rotation clockwise | |
mat2 m = mat2(cos(angle), -1.0 * sin(angle), sin(angle), cos(angle)); | |
vec2 P = vec2( | |
(m[0][0]*v.x) + (m[1][0]*v.y), | |
(m[0][1]*v.x) + (m[1][1]*v.y) | |
); | |
P.x = fract(cos(P.x)*221.2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Resource | |
class_name WorleyNoise | |
func hash_2d(v): | |
var angle = PI/8.0 # 22.5° clockwise | |
# Do rotation clockwise | |
var m = [ | |
[cos(angle), -1 * sin(angle)], | |
[sin(angle), cos(angle)] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lxcaddveth() { | |
local pid=$(lxc-info -n ${1} -p | awk '{print $2}') | |
mkdir -p /var/run/netns | |
ln -sf /proc/$pid/ns/net "/var/run/netns/${1}" | |
ip link add name veth${2} type veth peer name veth${2}_c | |
ip link set dev veth${2}_c netns ${1} name ${3} | |
lxc-attach -n ${1} /sbin/ifconfig ${3} up |