Skip to content

Instantly share code, notes, and snippets.

View vladzadvorny's full-sized avatar
🎯
Focusing

Vlad Zadvorny vladzadvorny

🎯
Focusing
  • Saint-Petersburg
View GitHub Profile
"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,
/**
$ 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/"
}
$(window).on('load', function() {
$(".loader").fadeOut("slow");
});
.loader {
position: fixed;
left: 0px;
top: 0px;
var paramsUrl = {
'one': 'hello',
'two': 'world'
};
function httpBuildQuery(_paramsUrl) {
var arr = [];
for (var key in _paramsUrl) {
arr.push(key + '=' + _paramsUrl[key]);
}
(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);
})();
# 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
for i in *.txt; do echo -e "\nFilename: $i\n"; cat "$i"; done > tmpfile; mv tmpfile all-files.txt;
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);
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}`));