Skip to content

Instantly share code, notes, and snippets.

@vrdriver
vrdriver / create_uuid1.php
Created January 16, 2024 05:00
Create a random UUID in PHP based on the UUID V1 format
<?php
/*
Create a random UUID in PHP based on the UUID V1 format
Output example: e22e1622-5c14-11ea-b2f3-0242ac130003
The MIT License (MIT)
Copyright (c) 2024 Stephen Monro
{
"name": "aap",
"version": "2.2.0",
"author": "me",
"homepage": "",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
@vrdriver
vrdriver / m3u8-to-mp4.md
Created November 17, 2020 08:42 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@vrdriver
vrdriver / settings-truncated.json
Created December 5, 2022 01:14
truncated json data
[{"id":"9","wp_url":"https://www.ucbasiapacific.org/wp-json/wp/v2/posts?categories=199","wp_media_url":"https://ucbasiapacific..org/wp-json/wp/v2/media/","name":"LifeFM Indo","website":"https://ucbasiapacific..org/","test_feed":"0","language":"Indonesian","active":"1","country":"Indonesia","country_code":"id","word_for_language":"Language","default_selected":"1","store":"https://www.ucbasiapacific.org/contact-us/","support":"https://www.ucbasiapacific.org/contact-us/","contact":"https://www.ucbasiapacific.org/contact-us/","wp_url_download_source":"https://www.ucbasiapacific.org/wp-json/wp/v2/posts?categories=199","listen_station_url":"https://livessl.rcast.net/stream/65809","station_name":"LifeFM Indo","MasterTWFTCustomSourceDataURL":"https://clients.bluetomatomedia.com/api/view_content_iso.php?ajf_id=13&ajfsd_app_id=11&l=10","station_logo":"https://www.ucbasiapacific.org/app-resources/artwork/indo/listen/station_logo_life_fm_indonesia_main.png","station_twft_source_icon":"https://www.ucbasiapacific.org/app-r
@vrdriver
vrdriver / settings.json
Last active December 5, 2022 01:12
JSON array of settings for app
[{"id":"9","wp_url":"https://www.ucbasiapacific.org/wp-json/wp/v2/posts?categories=199","wp_media_url":"https://ucbasiapacific..org/wp-json/wp/v2/media/","name":"LifeFM Indo","website":"https://ucbasiapacific..org/","test_feed":"0","language":"Indonesian","active":"1","country":"Indonesia","country_code":"id","word_for_language":"Language","default_selected":"1","store":"https://www.ucbasiapacific.org/contact-us/","support":"https://www.ucbasiapacific.org/contact-us/","contact":"https://www.ucbasiapacific.org/contact-us/","wp_url_download_source":"https://www.ucbasiapacific.org/wp-json/wp/v2/posts?categories=199","listen_station_url":"https://livessl.rcast.net/stream/65809","station_name":"LifeFM Indo","MasterTWFTCustomSourceDataURL":"https://clients.bluetomatomedia.com/api/view_content_iso.php?ajf_id=13&ajfsd_app_id=11&l=10","station_logo":"https://www.ucbasiapacific.org/app-resources/artwork/indo/listen/station_logo_life_fm_indonesia_main.png","station_twft_source_icon":"https://www.ucbasiapacific.org/app-r
@vrdriver
vrdriver / configCordovaPlugin.js
Last active April 19, 2022 00:53
An after sync script for 'npx cap sync' to fix up android:label="@string/activity_name" missing for AndroidManifest.xml
/*
Modifed by S. Monro 20220418
configCordovaPlugin.js
This gist was published after I wrote this post:
https://forum.ionicframework.com/t/android-build-fails-string-activity-name-not-found/200866/7?u=stephenmonro
In short, you can find problems that after using Ionic with Cordova and adding Capacitor as well, there's probably
// 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++)
@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.
// 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
*/
<!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>