Skip to content

Instantly share code, notes, and snippets.

@genpri
genpri / rxjs-diagrams.md
Created January 8, 2019 14:49 — forked from PCreations/rxjs-diagrams.md
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@genpri
genpri / angularjs-providers-explained.md
Created January 24, 2019 11:27 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@genpri
genpri / triforce.js
Created April 3, 2019 13:35 — forked from JoaoCnh/triforce.js
Solving the problem
// Let's reduce the array of arrays into a single one
const songNames = allSongs.reduce((acc, currValue) => {
return acc.concat(currValue);
}, [])
// Let's map it out with the seconds turned into minutes
.map(song => {
return { ...song, duration: Math.floor(song.duration / 60) };
})
// Let's filter the ones under 3 minutes
.filter(song => {
@genpri
genpri / TR Banka Bin List
Created June 19, 2019 06:53 — forked from serkanince/TR Banka Bin List
TR Banka Bin Listesi
SET NAMES utf8;
DROP TABLE IF EXISTS `cc_bins`;
CREATE TABLE `cc_bins` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`bank_code` int(11) NOT NULL,
`bank_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`bin_number` int(11) NOT NULL,
`card_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
@genpri
genpri / sink.js
Last active January 23, 2020 07:24
ts snippets and patterns
// validation pattern
const schema = {
first: {
required: true
},
last: {
required: true
}
};
@genpri
genpri / destructuring.js
Created February 12, 2020 11:01 — forked from mikaelbr/destructuring.js
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];