Skip to content

Instantly share code, notes, and snippets.

View cogdog's full-sized avatar

Alan Levine cogdog

View GitHub Profile
@bajpangosh
bajpangosh / index.html
Created November 27, 2018 08:09
YouTube API - Multiple Videos on One Page
<div class="video-item">
<iframe id="video0" src="//www.youtube.com/embed/4DMGfbje7NY?enablejsapi=1&html5=1" frameborder="0" allowfullscreen></iframe>
<button class="play">Play</button>
<button class="stop">Stop</button>
</div>
<div class="video-item">
<iframe id="video1" src="//www.youtube.com/embed/nJl-qVoEEJI?enablejsapi=1&html5=1" frameborder="0" allowfullscreen></iframe>
<button class="play">Play</button>
<button class="stop">Stop</button>
@b4oshany
b4oshany / discourse-api.php
Created October 8, 2020 10:28
Discourse API - Generate new topics, posts and PM
<?php
header('Content-Type: application/json');
//Make sure that it is a POST request.
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0) {
echo json_encode(array("error" => 'Request method must be POST!'));
}
//Make sure that the content type of the POST request has been set to application/json
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';