Skip to content

Instantly share code, notes, and snippets.

View dionedomingo's full-sized avatar
🎯
Focusing

Dione Domingo dionedomingo

🎯
Focusing
View GitHub Profile
@dionedomingo
dionedomingo / phpcs.xml
Created February 4, 2020 08:40
PHPCS XML
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>The coding standard for PHP_CodeSniffer itself.</description>
<file>autoload.php</file>
<file>bin</file>
<file>scripts</file>
<file>src</file>
<file>tests</file>
@dionedomingo
dionedomingo / Algolia Notes.md
Last active January 29, 2020 14:56
Algolia product data sender

Product

image

"img" : ".../bilkaimg.php??pid=..." ,

Duplicated ? which makes url to returns 504 without the image .

images

@dionedomingo
dionedomingo / README.md
Last active February 25, 2020 08:19
GitFlow + JIRA GITHUB + Development tools
@dionedomingo
dionedomingo / Usage.php
Last active January 23, 2020 12:20
PHP Calculator Class using bcmath
<?php
$number1 = 20;
$number2 = 15;
$subtractResult = Calculator::subtract( (string) $number1, (string) $number2);
$sum_result = Calculator::add( (string) $number1, (string) $number2);
$product_result = Calculator::multiply( (string) $number1, (string) $number2);
$quotient = Calculator::divide( (string) $number1, (string) $number2);
HTTPAUTH_USER='root'
HTTPAUTH_PASS='root'
HTTPD_DUMP_URL=
wget --user={$HTTPAUTH_USER} --password={$HTTPAUTH_PASS} -O /tmp/dump.sql.gz {$HTTPD_DUMP_URL}/latest.sql.gz
mysql -uroot -proot --silent --skip-column-names -e "SHOW TABLES" staging | xargs -L1 -I% echo 'DROP TABLE `%`;' | sudo mysql -uroot -proot -v staging
gunzip /tmp/dump.sql.gz
sudo mysql -u root staging < /tmp/dump.sql -v
sudo rm /tmp/dump.sql
# sudo rm /tmp/dump.sql.gz
wget https://github.com/dionedomingo/iposen-vagrant/archive/master.zip -O /tmp/iposen-setup.zip
unzip file.zip -d vagrant
@dionedomingo
dionedomingo / example.php
Created May 9, 2019 09:17
Drupal 8 drupal_set_message
<?php
// The drupal_set_message() function is being deprecated!
// @see https://api.drupal.org/api/drupal/core%21includes%21bootstrap.inc/function/drupal_set_message/8.5.x
// > Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
// > Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
// In some custom code.
\Drupal::messenger()->addMessage('Say something else');
// When trying to print out a simple var.
\Drupal::messenger()->addMessage(print_r($stuff, TRUE));
// In a Drupal 8 Form's submitForm() handler:
### Keybase proof
I hereby claim:
* I am dionedomingo on github.
* I am dione (https://keybase.io/dione) on keybase.
* I have a public key ASB5wcrCWT970XucrnO7U89YOABjpW_HEwyAB-Yg40fcewo
To claim this, I am signing this object:
@dionedomingo
dionedomingo / filecachedelete.sh
Created January 6, 2017 11:10
bash code to delete files by x number of days
find /var/www/example.com/files/cachefiles/ -mtime +90 -type f -delete