#require.js #PoC #topological-sorting #DAG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const npmPackageName = "ts-morph"; // <--- change name | |
const got = require("got@11.8.2"); | |
const url = (name) => | |
`https://api.npms.io/v2/package/${encodeURIComponent(name)}`; | |
const map = []; | |
require("npm-pack-dependents@2.0.0")(npmPackageName) | |
.then((dependents) => { | |
return Promise.allSettled( | |
dependents.map((d) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
namespace Proxy | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>abc abcd</title> | |
<script> | |
function ReplaceNode(textNode, eNode) { | |
textNode.parentNode.replaceChild(textNode, eNode); | |
} | |
function DecorateText(node, match, offset) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jsperf.com/circle-buffer-vc-array | |
var CircleBuffer = function (size) { | |
this._size = size; // max count of data | |
this._list = []; | |
this._cursorIndex = 0; | |
this._startIndex = 0; | |
this.length = 0; // actual data length | |
}; | |
CircleBuffer.prototype = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T XmlDeserializeFromString<T>(string objectData) | |
{ | |
return (T)XmlDeserializeFromString(objectData, typeof(T)); | |
} | |
public static object XmlDeserializeFromString(string objectData, Type type) | |
{ | |
var serializer = new XmlSerializer(type); | |
object result; |
NewerOlder