const fs = require(‘fs');
fs.readFile(__filename, function(err, data) {
console.log(data);
});
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 util = require('util') | |
const stream = require('stream') | |
const pipeline = util.promisify(stream.pipeline) | |
async function saveImage(rs, ws) { | |
await pipeline(rs, ws) | |
} |
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
Notification.prototype.__defineSetter__('onshow', function(callback) { | |
setTimeout(() => this.close(), 8000); | |
var speech = new SpeechSynthesisUtterance(this.body.replace(/@[a-z_]+\s?/gi, '')); | |
speech.lang = 'ja-JP'; | |
speech.voice = 'Kyoko'; | |
speechSynthesis.speak(speech); | |
}); | |
$$('#update-sound source').forEach((audio) => { | |
// https://notificationsounds.com/terms-of-use |
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
'use strict'; | |
let Redis = require('ioredis'); | |
let redis = new Redis({ | |
sentinels: [ | |
{ host: '127.0.0.1', port: 15379 }, | |
{ host: '127.0.0.1', port: 15380 }, | |
{ host: '127.0.0.1', port: 15381 } | |
], | |
name: 'mymaster' |
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
... | |
app.use(function(req, res, next){ | |
if (app.get('graceful_shutdown') === true) { | |
res.set('Connection', 'close'); | |
} | |
next(); | |
}); | |
app.set('graceful_shutdown_start', 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
yum_repository "atrpms" do | |
baseurl "http://dl.atrpms.net/el6.5-$basearch/atrpms/stable" | |
gpgkey "http://atrpms.net/RPM-GPG-KEY.atrpms" | |
enabled false | |
end | |
yum_repository "centos-base" do | |
baseurl "http://mirror.centos.org/centos/6.5/os/$basearch/" | |
gpgkey "http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6" | |
enabled false |