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);
}
| /** | |
| * 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'); |
| 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 | |
| } |
A collection of links to the excellent"Composing Software" series of medium stories by Eric Elliott.
| /* | |
| 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) |
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: shopping-management | |
| spec: | |
| containers: | |
| - name: shopping-management | |
| image: shopping-service | |
| resources: | |
| requests: |
| var q = 'tasks'; | |
| var open = require('amqplib').connect('amqp://localhost'); | |
| // Publisher | |
| open.then(function(conn) { | |
| return conn.createChannel(); | |
| }).then(function(ch) { | |
| return ch.assertQueue(q).then(function(ok) { |
| /* | |
| * Parses the request and dispatches multiple concurrent requests to each | |
| * internal endpoint. Results are aggregated and returned. | |
| */ | |
| function serviceDispatch(req, res) { | |
| var parsedUrl = url.parse(req.url); | |
| /*Service is where we maintain the requests which we want to aggregate/ | |
| Service.findOne({ url: parsedUrl.pathname }, function(err, service) { |
Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.
I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.
If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.
Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.