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 / cleanup-php-code.sh
Created January 29, 2017 19:44
Cleanup the indentation of your php, css, html, readme, and other files
#!/bin/bash
##
# Author: Pierre-Henry Soria <ph7software@gmail.com>
# Copyright: (c) 2012-2017, Pierre-Henry Soria. All Rights Reserved.
# License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
##
accepted_ext="-name '*.php' -or -name '*.css' -or -name '*.js' -or -name '*.html' -or -name '*.xml' -or -name '*.xsl' -or -name '*.xslt' -or -name '*.json' -or -name '*.yml' -or -name '*.tpl' -or -name '*.phs' -or -name '*.ph7' -or -name '*.sh' -or -name '*.sql' -or -name '*.ini' -or -name '*.md' -or -name '*.markdown' -or -name '.htaccess'"
exec="find . -type f \( $accepted_ext \) -print0 | xargs -0 perl -wi -pe"
@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 / index.php
Last active July 15, 2020 22:23
Split Testing (marketing A/B testing) with Wordpress - Display a Random Page with Wordpress. Frensh Tutorial 👉 https://01script.com/page-aleatoire-wordpress-split-testing/
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
Barriers to speed reading
--------------------------
Subvocalizing. Repeating what you read in your head (reading with your ears).
If you hear yourself reading, read faster.
Vocalizing. If your lips move as you read you are vocalizing your text. As long as you read vocalizing, you will only be able to read as fast as you can speak.
Let the texts pass into the mind directly from the eye, skipping the mouth and ear.
@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>
@andrewh
andrewh / qpasswd
Last active August 9, 2022 21:53
Password generator using a quantum random number generator
#!/usr/bin/env ruby
# qpasswd - password generator from quantum RNG
require 'open-uri'
rng = 'https://qrng.anu.edu.au/wp-content/plugins/colours-plugin/get_block_alpha.php'
ARGV.size < 1 ? pw_size = 16 : pw_size = ARGV[0].to_i
data = open(rng).read.strip.split('')
output = data.sample(pw_size)
@pH-7
pH-7 / .gitconfig
Last active October 26, 2022 00:13
My ~/.gitconfig
[user]
name = Pierre-Henry Soria
email = $EMAIL_ADDRESS
[init]
defaultBranch = main
[color]
diff = auto
status = auto
@pH-7
pH-7 / udemy-full-discount.py
Last active December 6, 2022 12:51
Get all Udemy Courses with 100% off Coupons thanks to growthcoupon.com & Importer.io
##########
##
## Get all Udemy Courses with 100% off Coupons thanks to growthcoupon.com & Importer.io
##
##########
from json import loads
from bs4 import BeautifulSoup
import mechanize
@pH-7
pH-7 / mylocalserverip.sh
Last active May 21, 2023 03:17
Get my server local IP (saver time if you change very often your machine) - https://github.com/HiDeaUp/hideaup.github.io
ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
@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();