Skip to content

Instantly share code, notes, and snippets.

View tvolodimir's full-sized avatar

Volodymyr tvolodimir

View GitHub Profile
@tvolodimir
tvolodimir / TimeActionWrapper.cs
Created September 14, 2014 07:28
TimeAction Wrapper
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using Timer = System.Timers.Timer;
public class TimerAction
{
private readonly Action action;
private readonly Timer timer;
@tvolodimir
tvolodimir / entry.js
Created April 27, 2016 12:12
rollup.js + babel + source map
let app = {};
import * as arrowFunction from './test_arrowFunction.js';
app.arrowFunction = arrowFunction;
import * as exportDefaultClass from './test_exportDefaultClass.js';
app.exportDefaultClass = exportDefaultClass;
window.app = app;
console.log(app);
@tvolodimir
tvolodimir / conditional-promises-chaining.ts
Last active May 25, 2018 11:04
#demo: promises/aysnc/callback js
// conditional promises chaining
function preTask(): Promise<void> {
console.log('pre task');
return Promise.resolve();
}
function task1(): Promise<void> {
console.log('task for type1');
return Promise.resolve();
@tvolodimir
tvolodimir / readme.md
Last active October 29, 2020 21:45
light require.js PoC

#require.js #PoC #topological-sorting #DAG

PoC of require.js

const npmPackageName = "ts-morph"; // <--- change name
const got = require("[email protected]");
const url = (name) =>
`https://api.npms.io/v2/package/${encodeURIComponent(name)}`;
const map = [];
require("[email protected]")(npmPackageName)
.then((dependents) => {
return Promise.allSettled(
dependents.map((d) => {