Skip to content

Instantly share code, notes, and snippets.

function getTime(){
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
return $HeadTime;
}
@semasping
semasping / entity.php
Created May 4, 2016 12:52
Класс для работы с Entity
<?php
require_once _ROOT . 'vendor/autoload.php'; //предполагаем композер для ADODB
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$ADODB_QUOTE_FIELDNAMES = true;
/**
* Базовый класс для бизнес-сущностей
* Реализует паттерн Active Directory
@semasping
semasping / gist:85c9262ce991417680d2f26d833b8fec
Created June 23, 2017 10:56
vestacp nginx php-fpm laravel template
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%/public;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
location / {
try_files $uri $uri/ /index.php?$query_string;
function(t, e) {
t.exports = [{
api: "database_api",
method: "set_subscribe_callback",
params: ["callback", "clearFilter"]
}, {
api: "database_api",
method: "set_pending_transaction_callback",
params: ["cb"]
}, {
@semasping
semasping / GolosPostNotifyBotController.php
Created September 12, 2017 07:56
GolosPostNotifyBotController
<?php
namespace App\Http\Controllers;
use App\BotUserNot;
use App\GolosBlackListForBots;
use App\GolosBotPost;
use App\GolosBotsSettings;
use App\semas\AdminNotify;
use App\semas\GolosApi;
@semasping
semasping / GolosProcessCreatePost.php
Created September 12, 2017 10:27
GolosProcessCreatePost
<?php
namespace App\Jobs;
use App\BotUserNot;
use App\GolosBlackListForBots;
use App\GolosBotPost;
use App\semas\AdminNotify;
use GrapheneNodeClient\Tools\Transliterator;
use Illuminate\Bus\Queueable;
@semasping
semasping / gist:ea34ff57294c2077a50f0c825d5b0fdf
Created November 1, 2017 18:42
golos witness Config for semasping
# Endpoint for P2P node to listen on
# p2p-endpoint =
# Maxmimum number of incoming connections on P2P endpoint
# p2p-max-connections =
# P2P nodes to connect to on startup (may specify multiple times)
# seed-node =
seed-node = 5.9.18.213:4243
seed-node = 52.32.75.69:4243
@semasping
semasping / vote.js
Last active November 8, 2017 14:26
//мучаю nodejs
//просто проголосовать:
const golos = require('golos-js');
/*
golos.config.set('websocket', 'wss://api.golos.cf');
golos.config.set('address_prefix', 'GLS');
golos.config.set('chain_id', '782a3039b478c839e4cb0c941ff4eaeb7df40bdd68bd441afd444b9da763de12');
Verifying my Blockstack ID is secured with the address 1CybbMfUEohkaaAEXB4NS6qfaa9sXcM9gs https://explorer.blockstack.org/address/1CybbMfUEohkaaAEXB4NS6qfaa9sXcM9gs
{
"dates": [
{
"date": "2020, 06, 10",
"hours": [
"12",
"13",
"14",
"15",