Skip to content

Instantly share code, notes, and snippets.

View pH-7's full-sized avatar
:octocat:
πŸ’‘Creative Engineer πŸš€ Enjoying Learning New Exciting Things! πŸ˜‹ =>My Way of Life 🏝

β™š PH⑦ de Soriaβ„’β™› pH-7

:octocat:
πŸ’‘Creative Engineer πŸš€ Enjoying Learning New Exciting Things! πŸ˜‹ =>My Way of Life 🏝
View GitHub Profile
@pH-7
pH-7 / software-info.xml
Last active August 9, 2022 21:25
pH7CMS's Software Info XML file. https://xml.ph7cms.com/software-info.xml
<?xml version="1.0"?>
<info>
<ph7>
<social-dating-cms>
<upd-alert>false</upd-alert>
<name>NaOH</name>
<version>7.0.0</version>
<sql-shcema-version>1.3.6</sql-shcema-version>
<build>1</build>
</social-dating-cms>
@pH-7
pH-7 / countries.xml
Created July 14, 2018 14:39
The list of countries in the world in XML format.
<?xml version="1.0" encoding="utf-8"?>
<!-- XML Countries List -->
<countries>
<country iso="AF" name="Afghanistan" />
<country iso="AL" name="Albania" />
<country iso="DZ" name="Algeria" />
<country iso="AS" name="American Samoa" />
<country iso="AD" name="Andorra" />
<country iso="AO" name="Angola" />
@pH-7
pH-7 / reset-admin-panel-IP-restriction.sql
Last active February 25, 2019 06:41
Reset the pH7CMS, admin panel's IP restriction. Sometimes, your public IP changed, or your website is hosted on a localhost, and you cannot log in anymore to your admin panel. By executing this query through your phpMyAdmin or MySQL command line, you will clear the IP you previously set, and you will again be able to log in to your admin dashboa…
--
-- Author: Pierre-Henry Soria <[email protected]>
-- Website: https://ph7cms.com
-- Copyright: (c) 2011-2019, Pierre-Henry Soria. All Rights Reserved.
-- License: GNU General Public License
--
---
-- Reset the pH7CMS, admin panel's IP restriction.
-- Sometimes, you cannot log in anymore to your admin panel, because your public IP changed, or your website is hosted on a localhost and cannot work with.
@pH-7
pH-7 / animal-counter.js
Last active December 12, 2021 06:18
πŸ¦’ The simplest animal counter, using JS ES6's reduce() 🐘
const animals = [
'Crocodile',
'giraffe',
'elephant',
'snake',
'elephant',
'giraffe',
'giraffe',
'chicken',
'crocodile'
@pH-7
pH-7 / InvalidDayMomentException.php
Last active March 28, 2022 19:56
Source code of my YouTube tutorial about handling multiple exceptions with PHP 7.1 - https://www.youtube.com/channel/UCGqLuT0upPiocwYSnnmqt2g
<?php
class InvalidDayMomentException extends InvalidArgumentException
{
}
@pH-7
pH-7 / usa-states.ts
Created May 4, 2022 11:16
List of the US state names and their abbreviations, handy stored in an array containing an object for each state details. Enjoy πŸ₯³
export default [
{
name: 'Alabama',
abbreviation: 'AL',
},
{
name: 'Alaska',
abbreviation: 'AK',
},
{
@pH-7
pH-7 / alfred-workflows.md
Last active March 1, 2025 06:45
My Alfred workflows

My Alfred productivity workflows

@pH-7
pH-7 / caps-naming-convention-programming.md
Last active May 23, 2023 11:24
Naming Convention - Programming

Caps, programming

  • UpperCamel case for classes. e.g., MyClass {}
  • lowerCamel case for variable names. e.g., myVar = "";
  • snake_case for Python functions and other functions delimited with underscores _ e.g., my_function();
@pH-7
pH-7 / preserve-caps-column-names-postgresql.md
Created December 19, 2022 07:14
Preserve cases of column/table names with PostgreSQL

If you name your PostgreSQL table names or column names with caps like lowerCamel / UpperCamel cases, you will need to surround the column names/table name with double quotes to preserve the case of their names since our the columns in our database are lowerCamel case. Otherwise, Postgres wouldn’t find them as it would look for lowercase-only names.

@pH-7
pH-7 / match.php
Last active January 17, 2023 19:50
PHP 8, `switch` VS `match`
<?php
$sDayPrefix = date('D');
$sMessage = match ($sDayPrefix) {
'Mon' => 'Hello Monday! Have a great week!',
'Tue' => 'Hello Tuesday! Have a great day!',
'Wed' => 'Happy hump day all!',
'Thu' => 'Almost the end of the working week!',
'Fri' => 'Yaay! Happy Friday!',
'Sat' => 'Enjoy your weekend! Have a great Saturday :)',