Skip to content

Instantly share code, notes, and snippets.

View comxd's full-sized avatar
🎯
Focusing

David DIVERRES comxd

🎯
Focusing
View GitHub Profile
@comxd
comxd / mysql_backup.sh
Last active October 21, 2020 10:28 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@comxd
comxd / convertCurrency.php
Last active January 24, 2018 17:59 — forked from dcblogdev/gist:8067095
Use Google finance calculator to convert currency with PHP 7+
<?php
function convertCurrency(float $amount, string $from, string $to){
$data = file_get_contents("https://finance.google.com/finance/converter?a={$amount}&from={$from}&to={$to}");
preg_match("/<span class=bld>([0-9\.]+) " . $currency_to . "<\/span>/", $data, $matches);
return (float)$matches[1];
}
echo convertCurrency(10.00, "GBP", "USD");
@comxd
comxd / TabContainerTabsRight.js
Created February 7, 2017 20:23
Right aligned tabs for TabContainer (Dojo Toolkit)
/**
* TabContainer with tabs aligned to the right
* @require dijit/layout/TabContainer
* @author ComExpertise SARL <https://www.comexpertise.com>
* @tutorial http://stackoverflow.com/questions/9433707/is-it-possible-to-align-dijit-layout-tabcontainer-tabs-to-the-right
* @version 1.0.0
*/
define([
"dijit/layout/TabContainer",
"dojo/_base/declare",