Skip to content

Instantly share code, notes, and snippets.

View hoodwink73's full-sized avatar

Arijit Bhattacharya hoodwink73

View GitHub Profile
@hoodwink73
hoodwink73 / promise.js
Last active August 29, 2015 13:58
An abstraction of the general GET method using new Promises in JS
// An abstraction of the general GET method using
// new Promises in JS
var get = function (url) {
// returns a promise object
return new Promise(function (resolve, reject) {
// the callback to the Promise constructor
// gets two callbacks as parameters
// the first is meant to be invoked for succes
// and second one for failures
var request = new XMLHTTPRequest();
@hoodwink73
hoodwink73 / codepenUtilies
Last active January 3, 2016 09:09
Often I found myself repeating a lot of 'sass' in my pens, so this is an attempt to save time to waste it back again.
// flatUI colors
$turquoise: #1abc9c
$emerland: #2ecc71
$peterRiver: #3498db
$amethyst: #9b59b6
$wetAsphalt: #34495e
$greenSea: #16a085
$nephritis: #27ae60
$belizeHole: #2980b9
$wisteria: #8e44ad
@hoodwink73
hoodwink73 / Design Patterns
Last active September 21, 2022 18:36
Make a collection an iterator which can iterate over a model property
JavaScript Design Patterns by Stoyan Stefanov is one of the most recommended JavaScript book you would come across the Internet.
I have already gone through it once.
But I always come back to it, to revise, and sometimes plot if I could apply any of the pattern to my work.
Here is a collection of patterns I use or intend to use. Sometimes, they are just as it is in the book or sometimes, I try augment it and make it better.