Skip to content

Instantly share code, notes, and snippets.

View pumbaEO's full-sized avatar
💭
war, hunting for Russians

Evhen Sosna pumbaEO

💭
war, hunting for Russians
  • Ukraine, Zaporizhzhia
View GitHub Profile
@pumbaEO
pumbaEO / gist:6411240
Last active December 22, 2015 03:38
#1C Проверка кода ЕДРПОУ для Украины.
Функция нфПолучитьКЧ_ЕДРПОУ(Код,ВесКоэф,СмещениеКоэф=0)
КонтрольнаяСумма=0;
Для ПерЦ=1 По СтрДлина(ВесКоэф) Цикл
КонтрольнаяСумма=КонтрольнаяСумма+(Число(Сред(Код,ПерЦ,1))*(Число(Сред(ВесКоэф,ПерЦ,1))+СмещениеКоэф));
КонецЦикла;
КонтрЧисло = КонтрольнаяСумма-Цел(КонтрольнаяСумма/11)*11;
Возврат КонтрЧисло;
КонецФункции //ПолучитьКЧ_ЕДРПОУ
// нфОшибкаЕДРПОУ ===============================
@pumbaEO
pumbaEO / gist:7636666
Created November 25, 2013 05:10
pre commit hook
#!/usr/bin/env python3
import os
import sys
import subprocess
import shutil
from os.path import exists
import logging
import logging
//Исправь, на правильный путь.
var pathTo1C = "c:\\Program Files (x86)\\1cv82\\8.2.15.319\\bin\\1cv8.exe";
//var pathToBase = "d:\\WORK\\1C\\diff1c\\basediff";
var pathToBase = "d:\\WORK\\repository\\repo\\git\\antbuild\\ibService";
var pathToV8reader = "d:\\WORK\\repository\\repo\\git\\precommit1c\\V8Reader.epf";
objArgs = WScript.Arguments;
num = objArgs.length;
if (num < 2)
{
var thisNamespace = "";
exports.handlers = {
beforeParse:function(e){
//Заменим все переводы строк на православно верный.
var logger = require("jsdoc/util/logger");
var sourceText = e.source.replace("\t\n", "\n", "gm");
var syntax = SyntaxAnalysis.AnalyseModule(sourceText);
var Lines = sourceText.split("\n");
for (var i = syntax.moduleMethodComments.length - 1; i >= 0; i--) {
@pumbaEO
pumbaEO / ruby
Created January 24, 2015 18:01
sqliteonec.rb
# encoding: utf-8
require "logstash/inputs/base"
require "logstash/namespace"
require "socket"
# Read rows from an sqlite database.
#
# This is most useful in cases where you are logging directly to a table.
# Any tables being watched must have an 'id' column that is monotonically
@pumbaEO
pumbaEO / gist:26e05e08bfa1200fff09
Created February 20, 2015 12:19
Подключение1скsql
Процедура ОтключитсяОтСервераSW() Экспорт
Команда = Неопределено;
мЕстьПодключениеКСерверу = Ложь
КонецПроцедуры
Процедура ПодключитсяКСерверуSW() Экспорт
Если мЕстьПодключениеКСерверу Тогда
Возврат
@echo off
set tmp=T:\Temp
set temp=T:\Temp
ram set USERPROFILE=T:\Profile
if not exist T:\APPDATA mkdir T:\APPDATA
rem if not exist T:\APPDATA\1C\1CEStart\ mkdir T:\APPDATA\1C\1CEStart\
rem xcopy %APPDATA%\1C\1CEStart\*.* t:\APPDATA\1C\1CEStart\
if not exist T:\APPDATA\1C\1CEStart\ xcopy %APPDATA%\1C\1CEStart\*.* t:\APPDATA\1C\1CEStart\
set APPDATA=t:\APPDATA
start /D "c:\Program Files (x86)\1cv82\common\" 1cestart.exe
@pumbaEO
pumbaEO / gist:26cd3d8a39ab9e71a698
Created March 13, 2015 11:35
node --max-old-space-size=60096 test.js
var fs = require('fs');
var filePath = 'coverage.json';
var importStream = fs.createReadStream(filePath, {flags: 'r', encoding: 'utf-8'});
importStream.on('data', function(chunk) {
console.info(chunk);
var pleaseBeAJSObject = JSON.parse(chunk);
// insert pleaseBeAJSObject in a database
#!/bin/sh
export WORKSPACE=`pwd`
echo $WORKSPACE
if test -d $WORKSPACE/build/ib; then rm -rf $WORKSPACE/build/ib; fi
mkdir $WORKSPACE/build -p
mkdir $WORKSPACE/build/ib -p
if test -d $WORKSPACE/test-reports; then rm -rf $WORKSPACE/test-reports; fi
@pumbaEO
pumbaEO / haporox-onec.tmpl
Created December 12, 2015 11:01
пример настройки haproxy для публикации репа 1с
global
maxconn {{or (key "service/haproxy/maxconn") 256}}
debug
defaults
mode http
timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}}
timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}}
timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}}