Skip to content

Instantly share code, notes, and snippets.

View Vasiliy-Bondarenko's full-sized avatar
💭
Open to new offers

Vasiliy Bondarenko Vasiliy-Bondarenko

💭
Open to new offers
  • @troybank
  • Bangkok, Thailand
View GitHub Profile
@Vasiliy-Bondarenko
Vasiliy-Bondarenko / gist:bc8da13e619587bde1a75c5e1819acce
Created February 4, 2021 05:17
TreasuryReportCalculationMatrix
class TreasuryReportCalculationMatrix:
product: string
order_side: string
payment: string
status: string
add_to_estimated_receive: bool
add_to_actual_receive: bool
add_to_estimated_pay: bool
add_to_actual_pay: bool
@Vasiliy-Bondarenko
Vasiliy-Bondarenko / sql_examples.sql
Last active February 2, 2021 07:52
ktbst events
-- create audit_log table
CREATE TABLE audit_log (
id BIGSERIAL PRIMARY KEY, -- autoincrementing id - this is how ISP can reliably query this table
object_type VARCHAR(255), -- transaction, customer, account
object_id BIGINT, -- initial object id
product VARCHAR(20) NULL, -- SET, FI, etc or null for non-transactions
side VARCHAR(10) NULL, -- BUY, SELL, etc or null
action VARCHAR(10) NOT NULL, -- INSERT, UPDATE, DELETE
timestamp TIMESTAMP NOT NULL, -- timestamp of the event
old_row_data JSON NULL, -- old row data or null (for inserts)

Keybase proof

I hereby claim:

  • I am vasiliy-bondarenko on github.
  • I am vasiliyab (https://keybase.io/vasiliyab) on keybase.
  • I have a public key ASBTmJWEYNg7yjOUBuS1El-dHKzcrcGlNH-w-SLQEnYykgo

To claim this, I am signing this object:

<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\ServiceProvider;
use Log;
use Route;
class AppServiceProvider extends ServiceProvider
@Vasiliy-Bondarenko
Vasiliy-Bondarenko / CommentIndexQuery.php
Created August 6, 2017 20:23
Building complex SQL query from request in Laravel
<?php namespace App\Queries;
use App\Models\User;
use Illuminate\Contracts\Pagination\Paginator;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\Request;
class CommentIndexQuery
{
/** @var Request */
@Vasiliy-Bondarenko
Vasiliy-Bondarenko / WebhooksTest.php
Last active June 16, 2017 02:19
Webhooks testing experiment. Just for fun :)
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Tests\withTestingEnvironment;
use Zttp\Zttp;
class WebhooksTest extends TestCase
{
@Vasiliy-Bondarenko
Vasiliy-Bondarenko / 99BottlesTest.php
Last active June 5, 2017 08:59
99 Bottles Test - PHP version. This is a port of the exercise test from Sandi Metz new book "99 Bottles of OOP"
<?php
/*
* 99 Bottles Test - PHP version.
* This is a port of the test from Sandi Metz new book "99 Bottles of OOP"
* The Book: https://www.sandimetz.com/99bottles/
* Test description: https://www.sandimetz.com/99bottles/sample#appendix-exercise
*/
namespace Tests\Feature;