Skip to content

Instantly share code, notes, and snippets.

@vrdriver
vrdriver / mysql_backup_import.php
Created April 8, 2017 05:53 — forked from aufa/mysql_backup_import.php
PHP function to backup and import database using MYSQLI
<?php
/**
* @author awan < nawa (at) yahoo (dot) com >
*
*/
/**
* Function to build SQL /Importing SQL DATA
*
<?php
/*
* 20170805 Added a few lines to stop a Refresh of a page from showing errors.
*
*
* This is a PHP library that handles calling reCAPTCHA.
* - Documentation and latest version
* https://developers.google.com/recaptcha/docs/php
* - Get a reCAPTCHA API Key
* https://www.google.com/recaptcha/admin/create
@vrdriver
vrdriver / timezone.php
Last active January 7, 2018 12:14 — forked from xeoncross/timezone.php
The perfect TimeZone selectbox list for PHP 5.3+
<?php
$regions = array(
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Asia' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Australia' => DateTimeZone::AUSTRALIA,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
@vrdriver
vrdriver / app.compentent.ts
Created April 29, 2018 03:26
An Ionic Cordova AngularJS back button working on the TABS example
import { Component, ViewChild } from '@angular/core';
import { App, Platform, AlertController } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { TabsPage } from '../pages/tabs/tabs';
import { WelcomePage } from '../pages/welcome/welcome';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@Component({
template: `<ion-nav [root]="rootPage"></ion-nav>`
@vrdriver
vrdriver / gist:7211c5faf8180599c1e68df1c3bf14a4
Created January 10, 2019 13:06
Strip the href link from a link
This will change a string of text link from (for example):
<a href="http://helloworld.com">Cool link</a>
to
helloworld.com
// Just exports the URL as text - with no link.
To process the following Billboard XML from the RCS Zetta radio playout system (as outputted through a MC v15 XML schema
using glue) in PHP, I do a conversion trick to make it actually usable in the XML processor.
Firstly, I pre-process all of the XML like this:
// dirty hack to fix the naming of xml fields.
$rawXML = str_replace("l:Link", "l_Link", $rawXML);
$rawXML = str_replace("s:Album", "s_Album", $rawXML);
$rawXML = str_replace("s:Song", "s_Song", $rawXML);
$rawXML = str_replace("t:Spot", "t_Spot", $rawXML);
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Country Map Example</title>
</head>
<body>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jvectormap@2.0.4/jquery-jvectormap.min.css" type="text/css">
<style>
// I added this suppliment to my configDB file, as it's included in every page that either logs in or requires a db connection.
/**
* A Compatibility library with PHP 5.5's simplified password hashing API.
*
* @author Anthony Ferrara <ircmaxell@php.net>
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @copyright 2012 The Authors
*/
@vrdriver
vrdriver / get_remote_mp3_metadata.php
Created May 6, 2020 02:09
Get the metadata from a remotely hosted MP3 File using php
<?php
/* Firstly, I didn’t create all of this. I’ve just making it easy to understand with a full example.
You can read more of it here, but only because of archive.org. https://web.archive.org/web/20160106095540/http://designaeon.com/2012/07/read-mp3-tags-without-downloading-it/
To begin, download this library from here: http://getid3.sourceforge.net/
When you open the zip folder, you’ll see ‘getid3’. Save that folder in to your working folder.
// Finding the integer values of a plottable for ScottPlot when you know the name/label of it
// For use with https://github.com/swharden/ScottPlot
formsPlot1.plt.PlotVLine(label: "green", lineWidth: 3, x: position, draggable: true, dragLimitLower: 0, dragLimitUpper: Global.samples[filename_value]);
String plotname = "";
int plottablescount = formsPlot1.plt.GetSettings(false).plottables.Count;
for (int i = 0; i < plottablescount; i++)