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 / 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 / gatsby-node.js
Created June 5, 2019 10:53
stub to use esm modules in gatsby-node
require = require('esm')(module)
module.exports = require('./gatsby-node.esm')
const path = require("path")
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "graphql", "react-hooks"],
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
export const colors = {
transparent: "transparent",
black: "#000",
white: "#fff",
gray: {
100: "#f7fafc",
200: "#edf2f7",
300: "#e2e8f0",
@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:

for f in *.js; do mv $f `basename $f .js`.jsx; done;
@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.

@bitwhys
bitwhys / fix-permissions.sh
Created January 14, 2019 19:20
simple script that fixes the file permissions recursively within a folder. This is useful for when you download a folder intended for Windows into a Linux environment
#! /usr/bin/env bash
find . -type d | while read line; do
chmod 775 "$line"
done
find . -type f | while read line; do
chmod 664 "$line"
done

About

I came up with these exercises for someone learning to code. But I thought more people might want to do them.

I like functional programming, so the exercises asks you to make functions that are common in functional programming. If you have learned a language, but want to learn more about functional programming, these exercises are for you.

The exercises were originally meant for Python, but doing them in JavaScript, Ruby or any Lisp (Scheme, Clojure, …) should work just as well. It should also be possible to do them in Java and C#, but it will probably not be as easy.

Most of the functions you are asked to create already exist in functional languages, or libraries for most languages. But it can be educational to implement them yourself.