Skip to content

Instantly share code, notes, and snippets.

arnisjuraga /
Last active Apr 26, 2020
Codeigniter 4 install, boilerplate, configuration
apt update
apt install php-intl #needed by default
php-sqlite3 #needed by default configuration for tests - uses sqlite 

composer create-project codeigniter4/appstarter myfirstproject
cd myfirstproject
composer require myth/auth:1.*@dev
arnisjuraga / gist:a377c591bdddda17b00108beb0bad1ed
Last active Apr 15, 2020
Remove DEFINER from MySQL mysqldump tool backup file
View gist:a377c591bdddda17b00108beb0bad1ed
# Documented from
cat backupfile.sql | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | sed -e 's/DEFINER[ ]*=[ ]*[^*]*PROCEDURE/PROCEDURE/' | sed -e 's/DEFINER[ ]*=[ ]*[^*]*FUNCTION/FUNCTION/' > result.sql
arnisjuraga / HTML_UnEncode.sql
Created Feb 13, 2020
Convert HTML entities to HTML code in MySQL
View HTML_UnEncode.sql
Function converts encoded HTML entities back to HTML tags in pure MySQL
-- Original method:
-- @Balmiopour comment added
Version history:
arnisjuraga / suffixsearch.php
Last active Sep 19, 2019
Search, is array strings matches suffix of another string
View suffixsearch.php
e.g. I need to search, if given string suffix characters (starts with) "allowed" characters.
$allowed = [ 'LV', 'LT' , 'IBAN' ];
$given = 'LViban8500';
arnisjuraga /
Last active Apr 3, 2020
A small script with manual steps, how to convert simple TWIG templates back to PHP markup. Used for Opencart, sequence is important. Will be updated as used for any new template.

TODO: automated script

Regex search-replace

Static variables echo

# Strings
arnisjuraga / 0_reuse_code.js
Created Dec 11, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.