Skip to content

Instantly share code, notes, and snippets.

View avoronkin's full-sized avatar

Alexandr Voronkin avoronkin

  • Saint-Petersburg
View GitHub Profile
<?php
namespace Webmis\Controllers\Rls;
// use \Propel;
// use \PDO;
// use \BasePeer;
// use \Criteria;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
// use Webmis\Models\DrugComponentQuery;
//http://www.antartica.cl/antartica/servlet/LibroServlet?action=searchLibros&busqueda=shirley
var host = 'http://www.antartica.cl';
var uri = '/antartica/servlet/LibroServlet?action=searchLibros&busqueda=';
var url = host + uri;
var cheerio = require('cheerio');
var utils = require('./utils');
var debug = require('debug')('bs:antartica.cl');
@avoronkin
avoronkin / app_require.js
Created April 29, 2017 15:31
app_require
global.app_require = function(name) {
return require(__dirname + '/' + name);
}
var fs = require('fs'),
config = app_require('config'),
common = app_require('utils/common');
@avoronkin
avoronkin / nginx_requests_per_hour.sh
Last active December 5, 2017 05:05
nginx requests count
grep "05/Dec" /var/log/nginx/access.log | grep GET | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":00"}' | sort -n | uniq -c
function waterfall (fns = []) {
return async (...args) => {
return fns.reduce((p, fn) => p.then(args => fn.apply(this, args)), Promise.resolve.call(this, args))
}
}
{
"Command": "PrintCheck",
"SignCalculation": "Сoming",
"Key": "BB720A776848",
"IP": "192.168.8.250",
"Port": "7777",
"Protocol": "TCP",
"MainData": [{
"Cashier": "TEST T.T"
}],
@avoronkin
avoronkin / lotto.js
Created September 19, 2019 20:52
lotto
function getTickets(){
var tickets = []
$('.bingo_ticket').each(function () {
var $ticket = $(this)
var numbers = []
$ticket.find('.numbers td').each(function () {