Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼
Inner Peace

Thamaraiselvam thamaraiselvam

🐼
Inner Peace
View GitHub Profile
@thamaraiselvam
thamaraiselvam / CLI.sh
Created Sep 22, 2017 — forked from rezzz-dev/CLI.sh
PHP Code Sniffer with WordPress Coding Standards and Atom
View CLI.sh
#Install PHP CodeSniffer
brew install homebrew/php/php-code-sniffer #if using Homebrew
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs #if you want to do it directly
#Install WordPress Coding Standards
git clone -b master https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs
#Add WordPress standards to PHPCS config
phpcs -i #shows the libraries installed
phpcs --config-set installed_paths <path to dir that you cloned>/wpcs
@thamaraiselvam
thamaraiselvam / Install atom
Last active Nov 9, 2018
Setting up Atom with WordPress and useful PHP packages
View Install atom
Base
Install atom here https://atom.io/
Install atom-ide-ui and ide-php packages to make atom to Atom PHP IDE
Theme
I love Monokai theme its really good in both sublime and atom
Go to install themes -> monokai -> install
Go to installed themes -> UI theme -> One Dark -> Syntax theme -> Monokai
@thamaraiselvam
thamaraiselvam / Change files and folders permission recursively.md
Last active Oct 4, 2021
Change folder and files permission to 755 / 644 recursively
View Change files and folders permission recursively.md

Use to set 755 for all the folders recursively

sudo find . -type d -exec chmod 0755 {} \;

Use to set 644 for all the files recursively

sudo find . -type f -exec chmod 0644 {} \;
View CodeAuth.txt
We rule the world. …
Nothing happens in our society without software. Nothing….
Without software: Phones don't ring. Cars don't start. Planes don't fly. Bombs don't explode. Ships don't sail. Ovens don't bake. Garage doors don't open. Money doesn't change hands. Electricity doesn't get generated. And we can't find our way to the store. …
I will not produce harmful code.
The code that I produce will always be my best work. I will not knowingly release code that is defective either in behavior or structure.
@thamaraiselvam
thamaraiselvam / Bash.sh
Created Feb 12, 2018
Fix WP Time Capsule , Cannot copy bridge issue
View Bash.sh
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@thamaraiselvam
thamaraiselvam / git.txt
Created Apr 17, 2018
How to change author name/email for past commits
View git.txt
git filter-branch --env-filter '
WRONG_EMAIL="wrong@example.com"
NEW_NAME="New Name Value"
NEW_EMAIL="correct@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
@thamaraiselvam
thamaraiselvam / nginx.conf
Created Jun 19, 2018
Working Nginx + Multisite + localhost + linux configuration
View nginx.conf
server {
##DM - uncomment following line for domain mapping
#listen 80 default_server;
server_name dev.multisite.com;
##DM - uncomment following line for domain mapping
#server_name_in_redirect off;
View aws_access_policy_for_wptc
{
"Version":"2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
View Database - MongoDB
MongoDB Design patterns based on application usage perspective:
The scheme depends on your application use case
Data Access Patterns
Number of reading vs update
what is the size of expected documents
Performance issues in MongoDB:
Schema Design:
{
View Technical deep
Pair programming
- State what you know
- Ask questions
- Start Simple
- Should be extendable
- Write tests
Data structure
-------------------
tree ( Eg: Filesystem tree, PATH /usr/home/tom)