Skip to content

Instantly share code, notes, and snippets.

View jackbarham's full-sized avatar

Jack Barham jackbarham

View GitHub Profile
const pkg = require('./package')
module.exports = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: 'Matter of Form',
<?php
namespace App\Http\Controllers;
use App\Models\User;
use App\Models\Page;
use App\Models\NewsItem;
use App\Models\VideoItem;
use App\Models\AudioItem;
use App\Models\GalleryItem;
var cookieDate = new Date();
cookieDate.setFullYear(cookieDate.getFullYear( ) + 1);
document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE; expires=" + cookieDate.toGMTString( ) + "; path=/";
qqq
sudo vim /etc/nginx/sites-available/vybecast.mac
{
"user": {
"id": 1,
"email": "jack@airboxmedia.com",
"username": "jackbarham",
"site_title": "DJ Jack Barham",
"full_name": "Jack Barham",
"country": "gb",
"city": "London",
"active": 1
// Request URL or embed code
$url = $request->input('youtube_url');
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) {
$code = $match[1];
} else {
return "Please try another YouTube URL or link";
}
@jackbarham
jackbarham / gist:bde9df1084c2abfcfa14
Last active August 29, 2015 14:23
Resolve Soundcloud URL to return track information as json in PHP (Laravel 5) - Requires: https://github.com/njasm/laravel5-soundcloud
// Soundcloud credentials
// Requires: https://github.com/njasm/laravel5-soundcloud
$facade = new SoundcloudFacade($clientID, $clientSecret);
// Get original URL from input
$main_url = $request->input('url');
// Send URL to Soundcloud and request track URL/ID
$json_url = $facade->get('/resolve', array('url' => $main_url))->request();
$array = $json_url->bodyArray();