Skip to content

Instantly share code, notes, and snippets.

View nyl2k8's full-sized avatar

Niall Lonergan nyl2k8

View GitHub Profile
@GarySwift
GarySwift / README.md
Last active April 4, 2018 10:34
Installation notes Garand Sticky (FoundationPress)
@erycamel
erycamel / gist:bb0e5653977d620e68ce
Last active March 11, 2021 11:12
Yii2 htaccess - How to hide frontend/web and backend/web COMPLETELY
Step 1
Create .htaccess file in root folder, i.e advanced/.htaccess and write below code.
---------------
Options +FollowSymlinks
RewriteEngine On
# deal with admin first
RewriteCond %{REQUEST_URI} ^/(admin) <------
RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]
@whyvez
whyvez / install-gm-w-librvg.sh
Last active February 15, 2023 23:01
Installs ImageMagick --with-librsvg on Amazon Linux
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
export PATH=/usr/bin:$PATH
export LDFLAGS=-L/usr/lib64:/usr/lib
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
export CPPFLAGS=-I/usr/include
sudo yum-config-manager --enable epel
#sudo yum update -y
sudo yum install -y gcc gcc-c++ glib2-devel.x86_64 libxml2-devel.x86_64 libpng-devel.x86_64 \
libjpeg-turbo-devel.x86_64 gobject-introspection.x86_64 gobject-introspection-devel.x86_64
@stephen-hill
stephen-hill / pdo-fetch-benchmark.php
Created May 3, 2013 10:52
Benchmark for the different PDO fetch styles.
<?php
set_time_limit(0);
// List of fetch styles to test
$fetchStyles = array(
'Assoc' => PDO::FETCH_ASSOC,
'Both' => PDO::FETCH_BOTH,
'Lazy' => PDO::FETCH_LAZY,
'Num' => PDO::FETCH_NUM,
@sepehr
sepehr / uk_postcode_validator.php
Last active July 10, 2022 08:31
PHP: UK Postcode Validation
/**
* Custom validation callback to validate UK postcodes.
*
* It also tries to format provided postcode in correct format.
*
* Note: It's only usable for "postcode" fields.
*/
public function check_postcode_uk($original_postcode)
{
// Set callback's custom error message (CI specific)