Skip to content

Instantly share code, notes, and snippets.

View valentineus's full-sized avatar
🏠
Working from home

Valentin Popov valentineus

🏠
Working from home
View GitHub Profile
@valentineus
valentineus / start-sync.sh
Created January 9, 2019 20:05
Synchronization of backup copies of repositories with code.
#!/bin/bash
# Author: Valentin Popov
# Email: info@valentineus.link
# Date: 2018-11-13
# Usage: /bin/bash start-sync.sh /path/to/input
# Description: Starting repository synchronization.
# Updating the Environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PATH="$PATH:/usr/local/scripts"
@valentineus
valentineus / bootstrap.php
Created March 3, 2019 12:21
An example of integration Slim Framework into 1C-Bitrix.
<?php
# local/php_interface/bootstrap.php
declare(strict_types = 1);
define('NOT_CHECK_PERMISSIONS', true);
define('NO_AGENT_CHECK', true);
$_SERVER['DOCUMENT_ROOT'] = dirname(__DIR__, 2);
"use strict";
function create(total) {
var result = [];
for (var i = 0; i < total; i++) {
result.push(i + 1);
}
return result;
@valentineus
valentineus / file-converter.js
Last active October 2, 2019 11:42
An example of recording and converting to mp3 to ElectronJS.
import ffmpeg from 'fluent-ffmpeg';
import { settings } from '../../../../system';
export default (incomingPatchFile, outgoingPatchFile) => {
const ffmpegPath = settings.get('system.ffmpeg.path', '');
ffmpeg.setFfmpegPath(ffmpegPath);
return new Promise((resolve, reject) => {
@valentineus
valentineus / gist:60eb7344346fe46a42d718f368c72181
Created January 13, 2020 07:36
Kayako starting templates
{% autoescape false %}
{{ contents }}
{{ footer }}
{% endautoescape %}
type SplitString = (value: string, length: number) => string[];
export const splitString: SplitString = (value: string, length: number): string[] => {
const chunks: string[] = [];
for (let index: number = 0; index < value.length; index += length) {
const chunk: string = value.slice(index, index + length);
chunks.push(chunk);
}
@valentineus
valentineus / shell.sh
Created June 1, 2020 10:16
Convert video file to audio file
ffmpeg -i filename.ogg -vn -c:a libopus -ar 16k -ac 1 -b:a 16k -vbr on -compression_level 10 new_filename.ogg