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
import redis from 'redis'; | |
import { promisify } from 'util'; | |
import { redisHost as host, redisPort as port } from './config'; | |
const client = redis.createClient({ host, port }); | |
client.on('ready', () => console.log('Redis is ready')); | |
client.on('error', err => console.log(`Radis ${err}`)); |
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 { read } = require("readdir"); | |
const fs = require("fs"); | |
const parser = require("subtitles-parser"); | |
const stream = fs.createWriteStream("./file.txt"); | |
read("/Users/vlad/Desktop/Node", ["**/*.srt"], (err, paths) => | |
paths.forEach(item => { | |
const srt = fs.readFileSync("/Users/vlad/Desktop/Node/" + item, "utf8"); | |
const data = parser.fromSrt(srt); |
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
for i in *.txt; do echo -e "\nFilename: $i\n"; cat "$i"; done > tmpfile; mv tmpfile all-files.txt; |
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
# Get | |
docker pull mariadb:latest | |
# Run | |
run --name mariadbtest -p 127.0.0.1:3305:3306 -e MYSQL_ROOT_PASSWORD=mypass -d mariadb | |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore |
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
(function () { | |
var table = document.createElement('table'); | |
for (var i = 0; i < 42; i++) { //24 | |
var row = table.insertRow(i); | |
for (var j = 0; j < 42; j++) { | |
row.insertCell(j); | |
} | |
} | |
document.querySelector('.display').appendChild(table); | |
})(); |
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
var paramsUrl = { | |
'one': 'hello', | |
'two': 'world' | |
}; | |
function httpBuildQuery(_paramsUrl) { | |
var arr = []; | |
for (var key in _paramsUrl) { | |
arr.push(key + '=' + _paramsUrl[key]); | |
} |
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
$(window).on('load', function() { | |
$(".loader").fadeOut("slow"); | |
}); | |
.loader { | |
position: fixed; | |
left: 0px; | |
top: 0px; |
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
/** | |
$ npm install -g bower | |
$ npm install --global gulp-cli | |
$ npm init && mkdir app\scss app\css app\js dist && copy nul .bowerrc && copy nul app\index.html && copy nul app\scss\main.scss && npm install --save-dev gulp browser-sync gulp-concat gulp-rename gulp-sass node-neat node-bourbon gulp-uglifyjs gulp-notify | |
.bowerrc | |
{ | |
"directory" : "app/libs/" | |
} |
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
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme", | |
"enable_tab_scrolling": false, | |
"fallback_encoding": "Cyrillic (Windows 1251)", | |
"font_face": "Monaco", | |
"font_size": 12, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"remember_open_files": true, |