float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
This file contains hidden or 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
CREATE TABLE Categories | |
( | |
CategoryID SERIAL PRIMARY KEY, | |
CategoryName VARCHAR(15) NOT NULL, | |
Description TEXT | |
); | |
CREATE TABLE CustomerGroupThresholds | |
( | |
CustomerGroupName VARCHAR(20), |
This file contains hidden or 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
const getVideoId = url => { | |
const videoIDRegEx = new RegExp(/v=(\S{11})/) | |
const matches = url.match(videoIDRegEx) | |
const [_, video_id] = matches | |
return video_id | |
} |
This file contains hidden or 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
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
This file contains hidden or 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
# The output of the slop command (from gist) is WIDTHxHEIGHT+X+Y | |
byzanz-record --duration=15 --x=<X> --y=<Y> --width=<WIDTH> --height=<HEIGHT> --delay=<time-before-start-of-recording> <file-name>.gif |
This file contains hidden or 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
wesbos() { | |
npx install-peerdeps --dev eslint-config-wesbos | |
echo "{\"extends\": [\"wesbos\"],\"rules\": {\"no-console\": 2,\"prettier/prettier\":[\"error\",{\"trailingComma\": \"all\",\"semi\": false,\"singleQuote\": true,\"printWidth\": 80,\"tabWidth\": 2}]}}" >> .eslintrc | |
} |
This file contains hidden or 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
slop -t 0 -b 1 ; notify-send "Selection info" "Area: ${W} x ${Y}px \n Position: X = ${X}px, Y = ${Y}px" && echo ${W}x${H} | xsel -b |
A collection of links to the excellent"Composing Software" series of medium stories by Eric Elliott.
This file contains hidden or 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
/* | |
Sample Implementation of Circuit Breaker using hystrixjs in NodeJS | |
It uses reactive principles | |
Link : https://www.npmjs.com/package/hystrixjs | |
*/ | |
var CommandsFactory = require('hystrixjs').commandFactory; | |
var serviceCommand = CommandsFactory.getOrCreate("Service on port :" + service.port + ":" + port) | |
.circuitBreakerErrorThresholdPercentage(service.errorThreshold) | |
.timeout(service.timeout) |
This file contains hidden or 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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: shopping-management | |
spec: | |
containers: | |
- name: shopping-management | |
image: shopping-service | |
resources: | |
requests: |
NewerOlder