Skip to content

Instantly share code, notes, and snippets.

Avatar

Tijn Kuyper Moc

View GitHub Profile
@Moc
Moc / discord.msg.send.php
Created Jun 3, 2020 — forked from Mo45/discord.msg.send.php
PHP - Send message to Discord via Webhook
View discord.msg.send.php
<?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
View regex.php
<?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);
View formpage for Hatori.php
<?php
require_once("class2.php");
require_once(HEADERF);
$sql = e107::getDb();
$ns = e107::getRender();
$frm = e107::getForm();
$text = '';
@Moc
Moc / gist:be9778e3c037859f1bbf
Last active Aug 29, 2015
e107 youtube bbcode https fix
View gist:be9778e3c037859f1bbf
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=");
View github latest commits xml
<?php
// Configuration ---------------------- //
$repo = "e107inc/e107";
$branch = "master";
// ------------------------------------ //
$git = simplexml_load_file("https://github.com/".$repo."/commits/".$branch.".atom");