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 / api.md
Last active November 16, 2020 09:29
Mock REST API typings and cheat sheet
@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
(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 / .gitignore
Last active December 5, 2016 17:08
node_modules
@ducin
ducin / .gitignore
Last active September 21, 2022 20:26
typescript namespaces example
dist
node_modules
npm-debug.log
@ducin
ducin / reveal.js
Created September 19, 2016 14:27
REVEAL.JS bonus
Reveal.configure({
keyboard: {
40: 'next',
38: 'prev'
}
});
@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 / .gitignore
Last active January 23, 2016 18:47
Grunt JSON-Schema-faker basic demo
node_modules/
output/
@ducin
ducin / README.md
Last active April 15, 2018 15:33
JSON-Schema-faker console basic demo

JSON-Schema-faker demo

Run the following:

npm install
node run.js

to execute the demo.

@ducin
ducin / argmapify.js
Created May 16, 2015 12:25
map positional arguments into options object
"use strict";
// run `npm install introspect` before
var introspect = require('introspect');
function generateEmail(firstName, lastName, provider) {
return firstName + "." + lastName + "@" + provider;
}
var argMapify = function(fn, argValues, context) {