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 / 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 / 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 <hi@ph7.me>
-- 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 / 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 / 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 / Binary-Search.js
Last active January 10, 2019 22:35
Binary Search
function doSearch(array, targetValue) {
var min = 0;
var max = array.length - 1;
var guess;
while (max >= min) {
guess = Math.floor((max + min) / 2 );
if (targetValue === array[guess]) {
return guess;
@pH-7
pH-7 / upgrade-ph7cms-8.0.2-to-10.0.sql
Created October 11, 2017 16:36
SQL script to update pH7CMS, from version 8.* to 10.*
--
-- Author: Pierre-Henry Soria <hi@ph7.me>
-- Copyright: (c) 2017, Pierre-Henry Soria. All Rights Reserved.
-- License: GNU General Public License
--
-- Change reserved MySQL column names
-- Using backticks around reserved MySQL words is ugly and not working well with all environments
ALTER TABLE pH7_Settings CHANGE `name` settingName varchar(64) NOT NULL;
ALTER TABLE pH7_Settings CHANGE `value` settingValue varchar(150) DEFAULT '';

Keybase proof

I hereby claim:

  • I am ph-7 on github.
  • I am ph7 (https://keybase.io/ph7) on keybase.
  • I have a public key ASBpSP6Z_pxWI1qQTkdQyMoomXruMnS2L4Zxmzda78uKewo

To claim this, I am signing this object:

@pH-7
pH-7 / git-prompt.sh
Created July 10, 2017 23:09
Git User - Nicer Terminal - Shows git branch in bash prompt
PS1='\[\033[0;36m\]\h:\w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]\[\033[0m\033[0;32m\]'
@pH-7
pH-7 / upgrade-ph7cms-7.1.3-to-8.0.*.sql
Last active July 6, 2017 11:08
SQL script to update pH7CMS, from version 7.1.3 to 8.0.*
--
-- Author: Pierre-Henry Soria <hello@ph7cms.com>
-- Copyright: (c) 2017, Pierre-Henry Soria. All Rights Reserved.
-- License: GNU General Public License; https://www.gnu.org/licenses/gpl-3.0.en.html
--
--- Replace 'PH7_' by your prefix set in "~/_protected/app/configs/config.ini" [database] prefix
INSERT INTO PH7_Settings (`name`, value, `desc`, `group`) VALUES
@pH-7
pH-7 / upgrade-ph7cms-5.*-to-7.1.3.sql
Last active July 1, 2017 22:09
SQL script to update pH7CMS from version 5.* to 7.1.3
--
-- Author: Pierre-Henry Soria <hello@ph7cms.com>
-- Copyright: (c) 2017, Pierre-Henry Soria. All Rights Reserved.
-- License: GNU General Public License; https://www.gnu.org/licenses/gpl-3.0.en.html
--
--- Replace 'PH7_' by your prefix set in "~/_protected/app/configs/config.ini" [database] prefix
INSERT INTO PH7_Settings (`name`, value, `desc`, `group`) VALUES