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 <[email protected]>
# 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 / 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 / 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.
@cliffordfajardo
cliffordfajardo / deep-work-quotes.md
Last active December 4, 2024 15:10
Quotes from Cal Newport's Deep Work book

Deep Work Quotes

Deep Work Video


Introductory Quotes into the Topic of Deep Work:

  • β€œDeep Work: Professional activities performed in a state of distraction-free concentration that push your cognitive capabilities to their limit. These efforts create new value, improve your skill, and are hard to replicate.” (3)

    • Deep work is necessary to wring every last drop of value out of your current intellectual capacity. We now know from decades of research in both psychology and neuroscience that the state of mental strain that accompanies deep work is also necessary to improve your abilities.” (3)
  • β€œShallow Work: Noncognitively demanding, logistical-style tasks, often performed while distracted. These efforts tend to not create much new value in the world and are easy to replicate.” (6)

@pH-7
pH-7 / alfred-workflows.md
Last active June 16, 2025 10:54
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 / DataFrameSample.R
Last active May 8, 2025 14:15
Data Frames, object structure in R
# create a data frame
user_df <- data.frame(
name = c("Alice", "Bob", "Charlie", "Dave"),
age = c(25, 32, 47, 19),
city = c("New York", "San Francisco", "Los Angeles", "Chicago"),
stringsAsFactors = FALSE
)
# view the data frame
user_df
@pH-7
pH-7 / install-ruby-rails-macos.md
Last active August 12, 2023 09:41
How to install Ruby 3 with Rails v7, on macOS?

How to install Ruby & Rails on macOS?

Here are the simple 4 steps to install Ruby 3 and Rails v7 on macOS

Step 1: Install Homebrew

First, open your Terminal and run the following steps (I personally use iTerm2).

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@pH-7
pH-7 / fix-no-matches-found-zsh.sh
Created August 12, 2023 04:52
Run the following in your terminal to fix the unescaped arguments with matching arguments with Z shell. This will fix errors such as "zsh: no matches found: head^" error
echo "\n# Allow unmatched wildcard expressions in zsh\nsetopt NO_NOMATCH" >> ~/.zshrc
@pH-7
pH-7 / library-versus-require-in-R.md
Last active May 8, 2025 14:25
Which one is best to use when loading a library in R? - "library()" VS "require()" function in R

library VS require in R

When loading a library, always use library. Never use require

TL;DR: require breaks one of the fundamental rules of robust software systems, fail early.

In a nutshell, this is because, when using require, your code might yield different, erroneous results without signalling an error. This is rare, but not hypothetical! Note that require returns the boolean TRUE if the package is successfully loaded, and FALSE if it is not.

On the other hand, require does install the package if it hasn’t been installed (whereas library doesn’t).