Skip to content

Instantly share code, notes, and snippets.

View alfredleo's full-sized avatar
:octocat:
Working from Ground Zero

Alfred alfredleo

:octocat:
Working from Ground Zero
  • ITMED
  • Tashkent
View GitHub Profile
@alfredleo
alfredleo / KMP.py
Last active August 29, 2015 14:16 — forked from kylebgorman/KMP.py
#!/usr/bin/env python
# Knuth-Morris-Pratt demonstration
# Kyle Gorman <kgorman@ling.upenn.edu>
#
# A naive Python implementation of a function that returns the (first) index of
# a sequence in a supersequence is the following:
def subsequence(needle, haystack):
"""
Naive subsequence indexer; None if not found
@alfredleo
alfredleo / frontend.md
Last active December 20, 2017 13:56
Frontend, JS, PHP, OOP learning.
@alfredleo
alfredleo / getLinks.js
Created January 8, 2018 13:49
Mov.uz video download
@alfredleo
alfredleo / TVarDumper.php
Created February 7, 2018 10:26
PHP dumping to file function, just include this to the starting file.
<?php
/**
* TVarDumper class file
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Util
@alfredleo
alfredleo / script.sh
Created March 1, 2018 10:57 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@alfredleo
alfredleo / script.sh
Created March 1, 2018 10:57 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@alfredleo
alfredleo / TVarDumper.php
Created July 10, 2018 14:24
Debug function for any php project. Works fine with ajax debug, remote user debug. tail -f for log view.
<?php
/**
* TVarDumper class file
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
* @copyright Copyright &copy; 2005-2013 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Util
@alfredleo
alfredleo / code-review-checklist.md
Created August 18, 2018 16:59 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@alfredleo
alfredleo / usage git lg, git lg -p
Last active February 19, 2019 13:15
Beautiful git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@alfredleo
alfredleo / ITMED
Created September 23, 2020 09:31
Задание для дизайнера.
1) Перевести логотип в вектор. (1й файл)
2) Обозначить слово IT. Сейчас оно не выделяется. (2й файл)
3) Добавить изменения в логотип на ваше усмотрение. (3й файл)
По этим трем файлам и вашему портфолио будет принято решение о сотрудничестве.