This file contains hidden or 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
(function ($) { | |
var elements = { | |
html: document.documentElement | |
body: document.body | |
}; | |
$(elements.body).one('touchstart', function () { | |
$(elements.body).off('mouseenter.cursor-detection'); | |
}); | |
$(elements.body).one('mouseenter.cursor-detection', function () { |
This file contains hidden or 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 fork = require('child_process').fork; | |
const program = path.resolve('other.js'); | |
const child = fork(program); |
This file contains hidden or 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 fork = require('child_process').fork; | |
const program = path.resolve('other.js'); | |
const child = fork(program, [], { | |
silent: true | |
}); |
This file contains hidden or 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 fork = require('child_process').fork; | |
const program = path.resolve('program.js'); | |
const parameters = []; | |
const options = { | |
stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ] | |
}; | |
const child = fork(program, parameters, options); |
This file contains hidden or 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
if (process.send) { | |
process.send("Hello"); | |
} | |
process.on('message', message => { | |
console.log('message from parent:', message); | |
}); |
This file contains hidden or 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 spawn = require('child_process').spawn; | |
const command = 'node'; | |
const parameters = [path.resolve('program.js')]; | |
const child = spawn(command, parameters, { | |
stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ] | |
}); |
This file contains hidden or 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 ipc = require('node-ipc'); | |
ipc.config.id = 'a-unique-process-name1'; | |
ipc.config.retry = 1500; | |
ipc.config.silent = true; | |
ipc.serve(() => ipc.server.on('a-unique-message-name', message => { | |
console.log(message); | |
})); | |
ipc.server.start(); |
This file contains hidden or 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 cluster = require('cluster'); | |
const http = require('http'); | |
const numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
// Fork workers. | |
for (var i = 0; i < numCPUs; i++) { | |
cluster.fork(); | |
} |
This file contains hidden or 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 cluster = require('cluster'); | |
const http = require('http'); | |
if (cluster.isMaster) { | |
// init cluster | |
require('os').cpus().forEach(() => { | |
cluster.fork(); | |
}); | |
// add eventlisteners |
This file contains hidden or 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
import React from 'react'; | |
import styled from 'styled-components'; | |
const breakpoints = { | |
xs: '(max-width: 400px)', | |
sm: '(min-width: 401px) and (max-width: 520px)', | |
md: '(min-width: 521px) and (max-width: 720px)', | |
lg: '(min-width: 721px) and (max-width: 980px)', | |
xl: '(min-width: 981px)', | |
}; |
OlderNewer