Skip to content

Instantly share code, notes, and snippets.

View ybrodsky's full-sized avatar

Yael Brodsky ybrodsky

View GitHub Profile
@ybrodsky
ybrodsky / notes.js
Created September 10, 2018 14:09
Guitar notes frequency
// extracted from here https://www.talkbass.com/threads/fretboard-frequencies.1194275/
const NOTES = [
{
string: 'E',
notes: [
{ note: 'E', freq: 330 },
{ note: 'F', freq: 349 },
{ note: 'F#', freq: 370 },
{ note: 'G', freq: 392 },
{ note: 'G#', freq: 415 },
@ybrodsky
ybrodsky / handler.js
Created November 10, 2017 15:28
Serverless: AWS Returned a resized image from S3 through API Gateway
/**
* Fetches and image from S3, resizes it (if you specify dimensions) and returns it.
* http://yourawsurl/img/myimage.png?s=100x100
*/
'use strict';
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
const Sharp = require('sharp');
@ybrodsky
ybrodsky / routes.js
Last active July 7, 2017 06:46
Express - dynamically load routes from a folder
/***
* This piece of code loads all the files from a routes folder
* For example in an app created via express-generator, it would load all the files
* from the /routes folder
*
* With this script you DON'T have to manually load routes in your app.js anymore
* app.use('/', require('./routes/index'));
*
* USAGE: In your app.js add the following line:
*