Skip to content

Instantly share code, notes, and snippets.

View sanderhelleso's full-sized avatar

sanderhelleso sanderhelleso

View GitHub Profile
@sanderhelleso
sanderhelleso / fibonacci.js
Created May 1, 2019 00:41
Implementation of the Fibonacci sequence using the dynamic programming concepts memozation & tabulation
function fibMemo(n, memo) {
if (memo[n]) return memo[n];
if (n <= 1) return 1;
return memo[n] = fibMemo(n - 1, memo) + fibMemo(n - 2, memo);
}
function fibTab(n) {
@sanderhelleso
sanderhelleso / avatarupload.go
Created March 23, 2019 05:23
Avatar(file) upload from form data in go
/*
Takes a valid file(png/jpg) from form data,
creates a unique user directory to store file
and lastly re-size the file to passed in dimmensions
and copies the filebytes to the directory
*/
// AvatarUpload handle uploading of a users profile avatar
func (p *Profiles) AvatarUpload(c *gin.Context) {