Skip to content

Instantly share code, notes, and snippets.

@meorajrul
meorajrul / install_oci8_ubuntu_16.04_php7.1.md
Created April 4, 2018 23:07 — forked from hewerthomn/install_oci8_ubuntu_16.04_php7.1.md
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
@meorajrul
meorajrul / postgres_drop_all_table_and_schema.sql
Created May 15, 2018 04:26
postgres drop all table and schema
DO $$ DECLARE
tabname RECORD;
BEGIN
FOR tabname IN (SELECT tablename
FROM pg_tables
WHERE schemaname = current_schema())
LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(tabname.tablename) || ' CASCADE';
END LOOP;
END $$;
@meorajrul
meorajrul / macro.md
Created May 18, 2018 07:48 — forked from brunogaspar/macro.md
Recursive Laravel Collection Macros

What?

If a nested array is passed into a Laravel Collection, by default these will be threaded as normal arrays.

However, that's not always the ideal case and it would be nice if we could have nested collections in a cleaner way.

This is where this macro comes in handy.

Setup

@meorajrul
meorajrul / Laragon Multiple PHP Version (package-manager).md
Last active May 10, 2024 13:06
laragon-multi-php-version-via-package-manager.md

Manage your php version via Laragon PHP UI switcher with help of powershell package manager.

For this sake ill be using https://github.com/mlocati/powershell-phpmanager) package manage to handle multi version instead of download the zip file manually. The reason why i want to using this package manager is because it easy for me to add new extension like how linux and mac do. For example, installing imagick on windows is such a hassle. Not to mention if you keep switching your laptop or pc it could make it hard to just install all back without any semi or automated script laying around.

Disclaimer

@meorajrul
meorajrul / Laragon Multiple MySQL Database Version.md
Last active November 11, 2024 12:39
Laragon Multiple MySQL Database Version Setup

Pre-requisite

  1. Laragon
  2. Multiple DB are ready to install (look table below)
  3. Unzip tools like 7zip or Winrar
  4. Laragon installation path default is C:\laragon\, might be different depending on where you install this. However we will focus on laragon mysql directory folder which located on C:\laragon\bin\mysql

If you look at Laragon documentation on multiple DB it should be straight forward however i would like to make it as painless as possible with the setup

By default Laragon (Full version) comes with MySQL 8.0.* version. However we will install latest or older version of MySQL show how we switch to one another using Laragon system tray mysql version switch feature.

# Steps
* Install laragon [https://laragon.org/download/](https://laragon.org/download/)
* Install .net framework for both x86 and x64 [https://www.microsoft.com/en-my/download/details.aspx?id=21](https://www.microsoft.com/en-my/download/details.aspx?id=21)
* Get binary from postgres [https://www.enterprisedb.com/download-postgresql-binaries](https://www.enterprisedb.com/download-postgresql-binaries)
* extract all your binaries file inside `pgsql` to `<drive:/>/laragon/bin/postgres/<name of current binaries>`
* `cd laragon/bin/postgres/<installed binary folder>` open command prompt from here(control right click and open cmd), execute `createdb`
* try login with default username (`postgres`) and password (`password`)