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 / 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 / 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 / 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