Skip to content

Instantly share code, notes, and snippets.

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

Simon Muravev Zulcom

🏠
Working from home
View GitHub Profile
@Zulcom
Zulcom / upload.js
Created May 31, 2022 20:17
Загрузка видео mp4 используя VK API и node js / nodejs axios vk api video upload
import axios from 'axios';
import FormData from 'form-data';
import fs from 'fs'
const base = 'https://api.vk.com/method/'
const baseParams = {
v: "5.131",
access_token: VK_TOKEN
}
const vk = axios.create({
@Zulcom
Zulcom / Program.cs
Created May 4, 2020 18:35
C# - Прочитать два массива, слить их и отсортировать пузырьком, вставками или быстрой сортировкой на выбор пользователя
/*
Написать программу имеющую текстовое меню, реализующую следующие функции:
Решить с использованием: а. Сортировки «Пузырьком», б. Сортировки «вставками», в.
«Быстрой сортировкой»
Даны два упорядоченных набора чисел D1,D2 ,...,Dn и B1,B2,...,Bm. Соединить их в
один упорядоченный массив P.
*/
using System;
namespace arrays
@Zulcom
Zulcom / Program.cs
Created May 4, 2020 17:53
С# - Скопировать в out.txt предложения с фразой искомой в input.txt
using System;
using System.Collections.Generic;
using System.IO;
namespace files
{
class Program
{
static string prompt(string question)
{
@Zulcom
Zulcom / Program.cs
Created May 4, 2020 14:41
С# - есть ли в данном слове заданная подстрока
using System;
namespace functions
{
class Program
{
static string prompt(string question)
{
Console.WriteLine(question); // пишем запрос в консоль
return Console.ReadLine(); // возвращаем ввод от пользователя в переменную
}
@Zulcom
Zulcom / Program.cs
Created May 4, 2020 14:20
C# – Удалить из введёной строки все согласные буквы.
using System;
using System.Text.RegularExpressions;
namespace strings
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Type in string to process:"); // пишем запрос в консоль
@Zulcom
Zulcom / index.html
Created October 29, 2019 19:02
PatternFly + AngularJS реактвные графики из HTML формы (отправить данные на сервер, нарисовать графики по JSON)
<html ng-app="patternfly.charts" lang="ru">
<head>
<title>Пример отрисовки графика по данным формы, обрабатываемой на сервере</title>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/jquery.js"></script>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/bootstrap.min.js"></script>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/bootstrap-select.js"></script>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/jquery-ui.js"></script>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/jquery.dataTables.js"></script>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/dataTables.select.js"></script>
<script src="https://patternfly.github.io/angular-patternfly/grunt-scripts/moment.js"></script>
@Zulcom
Zulcom / trigger.sql
Created September 28, 2018 10:15
Записывать кто когда и с каким запросом удаляет данные из базы MySQL
CREATE TRIGGER log_msg_deleting BEFORE DELETE ON your_table
FOR EACH ROW
BEGIN
DECLARE original_query VARCHAR(1024);
SET original_query = (SELECT concat(UNIX_TIMESTAMP(),user,host,INFO) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE id = CONNECTION_ID());
INSERT INTO `yourLogTable`(`yourMediumtextLogField`) VALUES (original_query);
END;
@Zulcom
Zulcom / Fraction.php
Created September 10, 2018 04:22
PHPUnit test demo related to presentation https://goo.gl/yw3U1y
<?php
namespace SfuKruto\model;
/**
* Класс-обработчик дробей
*/
class Fraction
{
/** @var int|Radical числитель */
@Zulcom
Zulcom / example.html
Created May 29, 2018 11:59
JQuery асинхронная загрузка JS при попадании на экран (асинхронная загрузка виджета сообществ вк)
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Hello, world</h1>
<div id="vk_groups"></div>
<script src="./example.js"></script>
@Zulcom
Zulcom / encoding.js
Created February 19, 2018 15:14
Node.js конвертирование всех файлов в каталоге из кодировки 866 в кодировку UTF-8(BOM)
// Node.js конвертирование всех файлов в каталоге из кодировки 866 в кодировку UTF-8(BOM)
// Node.js convert all files in directory from 866 codepage to UTF-8 (BOM)
var fs = require('fs');
var cptable = require('codepage');
fs.readdir('jav/', function (err, filenames) {
filenames.forEach(function (filename) {
fs.readFile('jav/' + filename, null, function (err, content) {
fs.appendFile("jav-utf/" + filename, cptable.utils.decode(866, content), function (err) {
console.log(filename);