Skip to content

Instantly share code, notes, and snippets.

@DmmitryIs
DmmitryIs / letters.php
Created April 29, 2019 10:41
Cyrillic (russian alphabet) letters range with latin codes
$letters = [
'A' => 'А',
'B' => 'Б',
'V' => 'В',
'G' => 'Г',
'D' => 'Д',
'E' => 'Е',
'J' => 'Ж',
'Z' => 'З',
'I' => 'И',
@DmmitryIs
DmmitryIs / scrollto.js
Created January 4, 2019 14:33
Scroll to element with jQuery
$([document.documentElement, document.body]).animate({
scrollTop: $('#needleElement').offset().top
}, 1000);
@DmmitryIs
DmmitryIs / symlink.php
Created November 30, 2018 15:46
Create symlink by php script
@DmmitryIs
DmmitryIs / console
Created March 23, 2018 08:10
The only supported ciphers are AES-128-CBC and AES-256-CBC (Laravel)
1. php artisan key:generate
2. php artisan config:clear
3. done
@DmmitryIs
DmmitryIs / LoginController.php
Last active November 6, 2017 09:03
Laravel 5.4/5.5 auth by email or username
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class LoginController extends Controller
@DmmitryIs
DmmitryIs / commonParts.php
Last active February 13, 2017 13:33
Find longest common parts of two strings
<?php
function commonParts($a, $b) {
$a = trim($a);
$b = trim($b);
$str = strlen($a) <= strlen($b) ? strtolower($a) : strtolower($b);
$pos = 0;
$max = 0;