Skip to content

Instantly share code, notes, and snippets.

View bitwhys's full-sized avatar
⌨️
Building

George Bockari bitwhys

⌨️
Building
View GitHub Profile
@bitwhys
bitwhys / GLSL-Noise.md
Created August 9, 2021 06:18 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

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);
}
@bitwhys
bitwhys / token-generator.js
Created April 22, 2020 22:28 — forked from ziluvatar/token-generator.js
Example of refreshing tokens with jwt
/**
* 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
}
@bitwhys
bitwhys / composing-software.md
Created September 8, 2019 00:53 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
/*
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)
@bitwhys
bitwhys / app.yaml
Created July 16, 2019 22:52 — forked from parthghiya/app.yaml
sample yml file for microservices configuration with memory resources limit and cpu limit
apiVersion: v1
kind: Pod
metadata:
name: shopping-management
spec:
containers:
- name: shopping-management
image: shopping-service
resources:
requests:
@bitwhys
bitwhys / async_queue.js
Created July 16, 2019 22:52 — forked from parthghiya/async_queue.js
Sample Queue Implementation to achieve Asychronous Messaging communication
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) {
@bitwhys
bitwhys / Aggregator.js
Created July 16, 2019 22:52 — forked from parthghiya/Aggregator.js
API Aggragation sample in microservices
/*
* 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) {
@bitwhys
bitwhys / API.md
Created April 20, 2019 20:46 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@bitwhys
bitwhys / project-ideas01.md
Created January 17, 2019 16:38 — forked from MWins/project-ideas01.md
Back end Projects - list

Project Ideas

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.