Skip to content

Instantly share code, notes, and snippets.

@roughsoft
roughsoft / native_js_drag_and_drop_helper.js
Created May 16, 2020 23:13 — forked from druska/native_js_drag_and_drop_helper.js
Create the `simulateDragDrop` function which can be used to simulate clicking and dragging one DOM Node onto another
function simulateDragDrop(sourceNode, destinationNode) {
var EVENT_TYPES = {
DRAG_END: 'dragend',
DRAG_START: 'dragstart',
DROP: 'drop'
}
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent")
event.initCustomEvent(type, true, true, null)
@roughsoft
roughsoft / dateCN.js
Created August 30, 2019 01:36 — forked from lvwzhen/dateCN.js
获取当前公历、农历、节气
// JavaScript Document
function RunGLNL() {
var today = new Date();
var d = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var DDDD = today.getFullYear() + "年" + [today.getMonth() + 1] + "月" + today.getDate() + "日";
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
@roughsoft
roughsoft / Runner.cs
Created November 8, 2018 12:59 — forked from ShadowCat7/Runner.cs
C# file for running multiple processes.
/*
* Written by ShadowCat7 (Lukas Attridge) in 2012.
* This program is a C# program used to run other programs.
* To use it, read the comments for places to put your code.
* It should be used to run a first process and then run
the second process based on the first process.
* Theoretically you could add any number of processes.
*/
using System;
@roughsoft
roughsoft / introrx.md
Created August 16, 2016 14:06 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)