Skip to content

Instantly share code, notes, and snippets.

View RafaelQuirino's full-sized avatar

Rafael David Quirino RafaelQuirino

View GitHub Profile
@RafaelQuirino
RafaelQuirino / require.js
Last active November 1, 2017 00:21 — forked from stamat/require.js
Javascript snippet that allows one to require it's files inside each other, without the need to reference them in the head of the htlm file.
/**
Worked this code out of stamat's gist. It had several issues back then.
It's mechanism is very simple. Load it in the html file first, and then
load your main script after that. Doing that you're able to create your
client-side app just requiring your files inside each other in a modular
fashion. It's awsome !!! ^^
*/
var _rmod = _rmod || {}; //require module namespace
_rmod.LOADED = false;
@RafaelQuirino
RafaelQuirino / plaunch.sh
Created October 1, 2018 18:19 — forked from maxdee/plaunch.sh
Launch Processing sketch from terminal
#!/bin/bash
# Place this file in a sketch folder and run it to launch your sketch
# You need to have processing-java installed https://github.com/processing/processing/wiki/Command-Line
# Usefull for developement when using other editors like Atom
# Usefull for launching with ssh, "DISPLAY=:0 ./plaunch.sh"
# Usefull for automaticaly launching a sketch on computer startup,
# specialy if you wish to be able to edit something in a .pde file and avoid having to re-export a application
processing-java --sketch="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" --output=/tmp/processing --force --run
<button onclick="recordStop()" id="record-stop-button">Record</button>
<button onclick="playAudio()" disabled id="play-audio-button">Play</button>
<script>
const recordAudio = () =>
new Promise(async resolve => {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const mediaRecorder = new MediaRecorder(stream);
const audioChunks = [];
mediaRecorder.addEventListener("dataavailable", event => {
@RafaelQuirino
RafaelQuirino / fourex.py
Created May 4, 2020 19:10 — forked from tartakynov/fourex.py
Fourier Extrapolation in Python
import numpy as np
import pylab as pl
from numpy import fft
def fourierExtrapolation(x, n_predict):
n = x.size
n_harm = 10 # number of harmonics in model
t = np.arange(0, n)
p = np.polyfit(t, x, 1) # find linear trend in x
x_notrend = x - p[0] * t # detrended x
@RafaelQuirino
RafaelQuirino / clean_code.md
Created November 4, 2021 01:17 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@RafaelQuirino
RafaelQuirino / docker-compose.yml
Created April 12, 2022 23:46 — forked from themonster2015/docker-compose.yml
BDE2020 Docker-compose.yml
version: "2"
services:
namenode:
build: ./namenode
image: bde2020/hadoop-namenode:1.1.0-hadoop2.7.1-java8
container_name: namenode
volumes:
- hadoop_namenode:/hadoop/dfs/name
environment: