Skip to content

Instantly share code, notes, and snippets.

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

Alexandr Zhuravlev alezhu

🏠
Working from home
View GitHub Profile
@alezhu
alezhu / 0_reuse_code.js
Created September 29, 2015 10:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
* .-'---`-.
*,' `.
*| \
*| \
*\ _ \
*,\ _ ,'-,/-)\
*( * \ \,' ,' ,'-)
* `._,) -',-')
* \/ ''/
* ) / /
@alezhu
alezhu / CheckAction.php
Created October 7, 2016 06:44
Simple Doctrine Annotation
use Doctrine\Common\Annotations\Annotation;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* Class Action
* @package App\Core
* @Annotation()
* @Target("METHOD")
*/
class CheckAction
@alezhu
alezhu / app.php
Created October 7, 2016 06:46
Allow doctrine annotations to use standard class loader
AnnotationRegistry::registerLoader('class_exists');
@alezhu
alezhu / ActionMiddleware.php
Last active October 7, 2016 06:53
Lumen middleware for check contoller methods availability via Doctrine annotation
<?php
/*
in app.php add
$app->routeMiddleware([
'action' =>\App\Http\Middleware\ActionMiddleware::class,
]);
AnnotationRegistry::registerLoader('class_exists');
in route add something like
$app->group([
@alezhu
alezhu / GetCellWidth.excel.vba
Created November 30, 2016 06:42
Excel ColumnWidth for merged cells too
Function GetCellWidth(ra As range) As Double
Dim vColWidth As Double
Dim cell As range
vColWidth = ra.ColumnWidth
If ra.MergeCells Then
vColWidth = 0
For Each cell In ra.MergeArea.Cells
vColWidth = vColWidth + cell.ColumnWidth
Next
End If
@alezhu
alezhu / GetCellPage.excel.vba
Created November 30, 2016 06:43
Page number for cell
Function GetCellPage(ra As range) As Long
Dim ws As Worksheet
GetCellPage = 0
Set ws = ra.Parent
Dim iRow As Long
If ws.HPageBreaks.Count > 0 Then
iRow = ra.Row
Do
GetCellPage = GetCellPage + 1
@alezhu
alezhu / zcl_call_fbl1n.abap
Created December 16, 2016 13:39
Call FBL1N with multi lifnr, bukrs, belnrs via batch input
CLASS zcl_call_fbl1n DEFINITION
PUBLIC
ABSTRACT
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
tt_bukrs TYPE STANDARD TABLE OF bukrs WITH DEFAULT KEY .
@alezhu
alezhu / ZCL_TVARVC.abap
Last active April 5, 2024 23:44
Class to work with TVARVC table (get value, get_range, check value equal)
class ZCL_TVARVC definition
public
abstract
final
create public .
public section.
class-methods CHECK_VALUE
importing
@alezhu
alezhu / class_decorator.ts
Last active July 9, 2018 08:18 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}