Skip to content

Instantly share code, notes, and snippets.

View Moc's full-sized avatar

Tijn Kuyper Moc

View GitHub Profile
@Moc
Moc / gist:be9778e3c037859f1bbf
Last active August 29, 2015 14:01
e107 youtube bbcode https fix
In e107_files/bbcode/bb_youtube.php on or around line 63 change this:
$validUrls = array("http://","www.","youtube.com/watch?v=","youtube.com/watch#!v=");
to
$validUrls = array("http://", "https://", "www.","youtube.com/watch?v=","youtube.com/watch#!v=");
<?php
require_once("class2.php");
require_once(HEADERF);
$sql = e107::getDb();
$ns = e107::getRender();
$frm = e107::getForm();
$text = '';
<?php
// Configuration ---------------------- //
$repo = "e107inc/e107";
$branch = "master";
// ------------------------------------ //
$git = simplexml_load_file("https://github.com/".$repo."/commits/".$branch.".atom");
@Moc
Moc / regex.php
Created February 19, 2019 15:41
<?php
$string1 = '<link href="/css/bs4-dynamic-fields-form-2.min.css" rel="stylesheet" media="screen">';
$string2 = '<script src="/cdn-cgi/apps/head/qx0HK83qWJ5I3r2xnETN-ETfo6s.js"></script>"';
$regex1 = '~<link(.*?)href="([^"]+)"(.*?)>~';
$regex2 = '/src=(["\'])(.*?)\1/';
$result1 = preg_match($regex1, $string1, $matches1);
$result2 = preg_match($regex2, $string2, $matches2);
@Moc
Moc / discord.msg.send.php
Created June 3, 2020 18:46 — forked from Mo45/discord.msg.send.php
PHP - Send message to Discord via Webhook
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting