Skip to content

Instantly share code, notes, and snippets.

View LukeTowers's full-sized avatar
❄️
Building a snowman

Luke Towers LukeTowers

❄️
Building a snowman
View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active November 12, 2024 19:08
Listen to your web pages
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active May 28, 2024 02:25
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@petehalverson
petehalverson / oc-tag-plugin-repo.sh
Last active May 17, 2019 23:45
October CMS plugin repo tag script
#!/bin/bash
# Tag your October CMS plugin's repo with versions.
# Run from plugin working directory
if [ ! -d .git ]; then
echo "Not a git repo" && exit 1;
elif [ ! -f updates/version.yaml ]; then
echo "Plugin version.yaml not found" && exit 1;
fi
@mbaxter91288
mbaxter91288 / StructuredData.php
Last active June 15, 2021 04:38
Add JSON-LD structured data into your October CMS website
<?php namespace Your\Namespace\Components;
use Cms\Classes\ComponentBase;
use Config;
class StructuredData extends ComponentBase
{
/**
* set the component's details
@elenakondrateva
elenakondrateva / OneOffSyncUploads.php
Last active March 8, 2020 20:12
Synchronise OctoberCMS media files with AWS S3 cloud
<?php
namespace Acme\Console;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Storage;
class OneOffSyncUploads extends Command
@nathansearles
nathansearles / isAutoplaySupported.js
Last active December 13, 2022 11:06
Test if HTML5 video autoplay is supported
// isAutoplaySupported(callback);
// Test if HTML5 video autoplay is supported
isAutoplaySupported = function(callback) {
// Is the callback a function?
if (typeof callback !== 'function') {
console.log('isAutoplaySupported: Callback must be a function!');
return false;
}
// Check if sessionStorage exist for autoplaySupported,
// if so we don't need to check for support again
@magnetikonline
magnetikonline / README.md
Last active September 5, 2024 14:55
Setting Nginx FastCGI response buffer sizes.
@endtwist
endtwist / lazy.js
Created November 17, 2011 19:22
Javascript asset lazy loading
/**
* Lazy load assets, call callback fn after all assets have loaded.
*
* Requires: jQuery or Zepto
*
* Usage:
* Lazy.load({"js": ["js/file.js"],
* "tpl": [{"src": "tpl/event.tpl", "id": "event-view"}],
* "css": ["css/file.css"]
* });