Skip to content

Instantly share code, notes, and snippets.

View ducin's full-sized avatar
🛠️
creatin' some stuff

Tomasz Ducin ducin

🛠️
creatin' some stuff
View GitHub Profile
@ducin
ducin / index.js
Created April 21, 2016 17:50
use `david` to check available dependency updates
var pkgPath = '<path to package.json file>';
var david = require('david'),
chalk = require('chalk'),
fs = require('fs');
var manifest = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
david.getDependencies(manifest, function (er, deps) {
console.log('\n', chalk.cyan('latest dependencies information for', manifest.name));
@ducin
ducin / reveal.js
Created September 19, 2016 14:27
REVEAL.JS bonus
Reveal.configure({
keyboard: {
40: 'next',
38: 'prev'
}
});
@ducin
ducin / .gitignore
Last active September 21, 2022 20:26
typescript namespaces example
dist
node_modules
npm-debug.log
@ducin
ducin / .gitignore
Last active December 5, 2016 17:08
node_modules
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("csp", [], factory);
else if(typeof exports === 'object')
exports["csp"] = factory();
else
root["csp"] = factory();
})(this, function() {
@ducin
ducin / readme.md
Last active April 21, 2017 17:54
resolvedSame - new promise aggregate

resolveSame - new promise aggregate

  • if all promises get rejected - aggregate gets rejected (with positional reasons)
  • if some promises get resolved, then:
    • if they all get resolved with the same value - aggregate gets resolved with theValue
    • otherwise (different resolved values) - aggregate gets rejected with first two different values
@ducin
ducin / api.md
Last active November 16, 2020 09:29
Mock REST API typings and cheat sheet
@ducin
ducin / model.js
Created September 15, 2018 18:31
const API_URL = 'http://localhost:3011/'
const OfficeModel = {
getCollection(){
return fetch(`${API_URL}offices`)
.then(res => res.json())
},
async __extendOfficeWithEmployees(office){
const employees = await EmployeeModel.getCollection(office.city)
return { ...office, employees }
@ducin
ducin / .gitignore
Last active November 15, 2018 13:58
data.json
node_modules
@ducin
ducin / LICENSE
Created December 28, 2018 13:12
Lorem Ipsum License
Lorem Ipsum License
Copyright (c) [year] [fullname]
Permission is Lorem ipsum hereby granted, dolor sit amet, free of charge,
to any person obtaining a copy consectetur adipiscing elit. Proin nibh augue
of this software and associated documentation files (the "Software"),
suscipit a, scelerisque sed, to deal lacinia in, mi. Cras vel lorem.
Etiam pellentesque aliquet tellus, in the Software without restriction,
Phasellus pharetra nulla ac diam. Quisque semper justo at risus including