Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
vec3 gammaCorrect(vec3 color, float gamma){ | |
return pow(color, vec3(1.0/gamma)); | |
} | |
vec3 levelRange(vec3 color, float minInput, float maxInput){ | |
return min(max(color - vec3(minInput), vec3(0.0)) / (vec3(maxInput) - vec3(minInput)), vec3(1.0)); | |
} | |
vec3 finalLevels(vec3 color, float minInput, float gamma, float maxInput){ | |
return gammaCorrect(levelRange(color, minInput, maxInput), gamma); |
var cameraZ = camera.position.z; | |
var planeZ = 5; | |
var distance = cameraZ - planeZ; | |
var aspect = viewWidth / viewHeight; | |
var vFov = camera.fov * Math.PI / 180; | |
var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance; | |
var planeWidthAtDistance = planeHeightAtDistance * aspect; | |
// or |
precision highp float; | |
uniform float time; | |
uniform vec2 mouse; | |
uniform vec2 resolution; | |
float ball(vec2 p, float fx, float fy, float ax, float ay) { | |
vec2 r = vec2(p.x + sin(time * fx) * ax, p.y + cos(time * fy) * ay); | |
return 0.09 / length(r); | |
} |
float levelChannel(float inPixel, float inBlack, float inGamma, float inWhite, float outBlack, float outWhite) { | |
return (pow(((inPixel * 255.0) - inBlack) / (inWhite - inBlack), inGamma) * (outWhite - outBlack) + outBlack) / 255.0; | |
} | |
vec3 levels(vec3 inPixel, float inBlack, float inGamma, float inWhite, float outBlack, float outWhite) { | |
vec3 o = vec3(1.0); | |
o.r = levelChannel(inPixel.r, inBlack, inGamma, inWhite, outBlack, outWhite); | |
o.g = levelChannel(inPixel.g, inBlack, inGamma, inWhite, outBlack, outWhite); | |
o.b = levelChannel(inPixel.b, inBlack, inGamma, inWhite, outBlack, outWhite); | |
return o; |
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HTML5 Canvas Transformation</title> | |
</head> | |
<body> | |
<script> | |
// Create our canvas and append it to the document body | |
var stage = document.createElement("canvas"); |
import ( | |
"fmt" | |
"log" | |
"os" | |
"sort" | |
) | |
// askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and | |
// then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as | |
// confirmations. If the input is not recognized, it will ask again. The function does not return |