Skip to content

Instantly share code, notes, and snippets.

@muhummadPatel
muhummadPatel / client.js
Created December 28, 2020 16:47 — forked from aerrity/client.js
P5.js, Node, Express & MongoDB: Circle update demo
let myCircle;
function setup() {
createCanvas(400, 400);
background(0);
// retrieve the x, y coords from the DB
fetch('/circle', {method: 'GET'})
.then(function(response) {
if(response.ok) return response.json();
throw new Error('Request failed.');
@muhummadPatel
muhummadPatel / script-template.sh
Created December 15, 2020 11:53 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
@muhummadPatel
muhummadPatel / example.ts
Created December 8, 2020 08:12 — forked from leafriend/example.ts
Client-side Load Balancing with Axios
import axios, { AxiosRequestConfig } from 'axios';
(async () => {
const config: AxiosRequestConfig = {
get baseURL() {
let baseURL = 'https://example.com';
// Select node here
return baseURL;
},
@muhummadPatel
muhummadPatel / circles.pde
Created January 26, 2017 11:00 — forked from brysonian/circles.pde
Basic circle packing in Processing
/*
VARIATIONS:
Draw lines between all circles
Draw lines between new circle and closest neighboor
Move new circle to exactly touch closest neighboor
Change fill or stroke depending on circle size
Change overlap threshold (slight overlap ok / large margin)
*/
@muhummadPatel
muhummadPatel / README-Template.md
Created November 8, 2016 10:23 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites