Skip to content

Instantly share code, notes, and snippets.

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);
@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.
@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 / 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,
<?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 / 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
*