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 / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dionedomingo
dionedomingo / new_gist_file.html
Last active August 29, 2015 14:10
Ustream openup a streaming video when channel is live require jQuery
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://static-cdn1.ustream.tv/js/libs/ustream-embedapi.js"></script>
<script type="text/javascript">
@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
### 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 / 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:
wget https://github.com/dionedomingo/iposen-vagrant/archive/master.zip -O /tmp/iposen-setup.zip
unzip file.zip -d vagrant
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
@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);
@dionedomingo
dionedomingo / README.md
Last active February 25, 2020 08:19
GitFlow + JIRA GITHUB + Development tools