Skip to content

Instantly share code, notes, and snippets.



  • Liftkeeper
  • Budapest, Hungary
View GitHub Profile
estysdesu / create_constraint_if_not_exists.sql
Last active Apr 30, 2020
[PostgreSQL: create constraint if not exists] not sure of sql compatibility with other engines #postgres #constraint #sql
View create_constraint_if_not_exists.sql
// vim: syntax=sql
CREATE OR REPLACE FUNCTION create_constraint_if_not_exists (t_name text, c_name text, constraint_sql text)
-- Look for our constraint
IF NOT EXISTS (SELECT constraint_name
FROM information_schema.constraint_column_usage
Werninator / php_detect_eol.php
Last active Oct 3, 2020
[php] detect EOL type from string
View php_detect_eol.php
* Detects the end-of-line character of a string.
* modified version from
* @param string $str The string to check.
* @param string $default Default EOL (if not detected).
* @return string The detected EOL, or default one.
function detectEol($str, $default = PHP_EOL) {
mohammedyunus009 /
Last active Nov 27, 2020 — forked from rajeevkannav/
Install CMake, pkg-config,GNU Getopt,GCC,poppler,fontforge,pdf2htmlEX in Ubuntu 16.05
# Ubuntu Developer Script For pdf2htmlEx
# Created by Rajeev Kannav Sharma
# Downloads and configures the following:
# CMake, pkg-config
# GNU Getopt
quonic / scum_sqlite.ps1
Last active Nov 15, 2020
For the game SCUM. This sets stats too 5 and skills to 4 for specified character.
View scum_sqlite.ps1
#Requires -Module PSSQLite
[Alias('Name', '')]
Updated for 9/2 patch
Updated by request of Truth91
spagu / pre-commit
Last active Nov 19, 2020
subversion pre-commit hook for PHP lint, PSR-2 and CSS validation + comments
View pre-commit
# Requirements:
# - PHP installed ( )
# - PHPCS installed ( + )
# - csslint installed ( )
# - i18n0lint installed ( )
View template.yml
Type: AWS::EC2::Image::Id
Default: 'ami-5055cd3f'
Type: String
Default: t2.micro
Type: String
anvk / psql_useful_stat_queries.sql
Last active Jan 22, 2021
List of some useful Stat Queries for PSQL
View psql_useful_stat_queries.sql
--- PSQL queries which also duplicated from
--- some of them taken from
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
-- Basics --
-- Get indexes of tables
mikoim /
Last active Jan 14, 2021
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)


Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

SimonEast / Acceptance.php
Last active Dec 21, 2020
Codeception - how to test for redirects
View Acceptance.php
// Simply place the following two functions in _support/Helper/Acceptance.php
// Then you can call $I->verifyRedirect(...) inside your tests
namespace Helper;
class Acceptance extends \Codeception\Module
* Ensure that a particular URL does NOT contain a 301/302
agarzon /
Last active Jan 13, 2020
Install globally popular PHP dev tools like composer, phpunit, phpcs, phpmd, phpcpd, deployer, robo, codeception, etc.
#To execute it directly: sudo bash <(curl -s
sudo curl -LsS -o ${BIN_PATH}composer
sudo chmod a+x ${BIN_PATH}composer