Skip to content

Instantly share code, notes, and snippets.

View rgen3's full-sized avatar

Alexander Tanaev rgen3

View GitHub Profile
cd vendor/bin
rm -rf ./*
ln -s ../codeception/base/codecept
ln -s ../cebe/markdown/bin/markdown
ln -s ../phpunit/phpunit/phpunit
ln -s ../yiisoft/yii2/yii
#!/bin/bash
head -c 100 /dev/urandom | sha256sum | head -c${1:-9}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
SELECT
click_unique,
click_total,
action_date,
orders_total,
payout_total,
to_pay,
payment_pending,
approved,
declined,
@rgen3
rgen3 / .gitconfig
Last active April 18, 2017 08:24 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = rgen3
email = rgen3@mail.ru
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
<?php
$camel = "thisIsCamelCase";
$id = preg_replace('/(?<![A-Z])([A-Z]+)/', '_$1', $camel);
$id = strtolower($id);
@rgen3
rgen3 / iterations.php
Last active April 13, 2017 14:07
Example of for
<?php
$meal = [
"breakfast" => "08:00",
"lunch" => "12:00",
"dinner" => "19:00"
];
/**
* Using for
*/
SELECT val
FROM (
SELECT arrayJoin(params.param_value) as val
FROM click
WHERE user_id = :user_id
)
WHERE like(val, :value)
LIMIT 10
SELECT
parameters,
total_clicks,
total_orders,
action_date,
approved,
declined,
pending
FROM (
SELECT
<?php
declare(ticks = 1);
class smartExit
{
private $exit = false;
public function __construct()
{
register_tick_function([$this, 'tick']);