Skip to content

Instantly share code, notes, and snippets.

View danigb's full-sized avatar

danigb danigb

  • InVideo
  • Seville, spain
View GitHub Profile
@danigb
danigb / _result.md
Last active September 24, 2018 14:53
Cyclic dependencies

Run: node a.js

Result:

A from C {}
C from B This is C
B from A This is B
@danigb
danigb / music.ts
Created August 13, 2018 09:31
Pitch classes et al
// Duration
export type Duration = number;
const PPQ: Duration = 960;
export const wn = 4 * PPQ; // whole note duration
export const hn = (1 / 2) * wn; // half note duration
export const qn = (1 / 4) * wn; // quarter note duration
export const en = (1 / 8) * wn; // eight note duration
export const sn = (1 / 16) * wn; // sixteenth note duration
export const tn = (1 / 32) * wn; // thirty-second note duration
@danigb
danigb / TEMPLATE.md
Last active June 29, 2018 14:19
Pull request template

What this PR do?

Why are we doing this? Any context or related work?

Summary of changes

Where should a reviewer start?

Testing steps

@danigb
danigb / .babelrc.json
Last active January 2, 2023 19:06
React + Parcel project setup
{
"presets": ["env", "react"],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread",
"react-hot-loader/babel"
]
}
@danigb
danigb / README.md
Last active May 23, 2018 15:42
MSSQL Mac
@danigb
danigb / .babelrc.json
Last active November 5, 2019 07:12
react parcel setup
{
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:react/recommended"],
"env": {
"browser": true,
"jest": true,
"es6": true
}
}
@danigb
danigb / VSPlugins.md
Last active April 19, 2018 08:28
Current VS Plugins

Font: Firacode with ligatures:

"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true

Can't live without

  • Vim
@danigb
danigb / README.md
Created April 17, 2018 22:18
promises from scratch
@danigb
danigb / errors.js
Created April 6, 2018 10:48
Custom API Errors
'use strict'
const httpStatus = require("http-status");
/**
* Extends the node base Error object to have status while capturing the stack trace
*/
class ApiError extends Error {
constructor(statusCode = 500, message = httpStatus[statusCode]) {
@danigb
danigb / setup.md
Last active July 27, 2022 08:32
Vagrant setup for ruby 1.8

How to create and setup a development virtual machine for old ruby/rails

Using VirtualBox and Vagrant

Install and create a virtual machine

Install virtualbox and Vagrant:

$ brew cask install virtualbox