Skip to content

Instantly share code, notes, and snippets.

View simon-ohara's full-sized avatar

Simon O'Hara simon-ohara

  • Canberra, Australia
View GitHub Profile
@tonton-sco-en-fr
tonton-sco-en-fr / shaka.d.ts
Last active December 9, 2021 16:00
shaka updated typings for v2.5.0-beta2 (by hand)
declare namespace shaka {
namespace media {
class InitSegmentReference {
/**
* Creates an InitSegmentReference, which provides the location to an initialization segment.
* @param uris A function that creates the URIs of the resource containing the segment.
* @param startByte The offset from the start of the resource to the start of the segment.
* @param endByte The offset from the start of the resource to the end of the segment, inclusive.
* null indicates that the segment extends to the end of the resource.
*/
@carcinocron
carcinocron / ddcors.php
Created September 1, 2017 15:12
CORS usable dd (laravel)
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
dd(__FILE__);
// or use a function
function ddcors(...$args) {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
@aisouard
aisouard / readVariableInt.js
Last active May 5, 2021 09:53
Reading an EBML variable-length integer
/**
* Read an EBML tag header or length and return their respective values into
* single numbers.
*
* @example
* var tagHeader = new Uint8Array([0x1A, 0x45, 0xDF, 0xA3, 0x01, 0x00, 0x00,
* 0x00, 0x00, 0x00, 0x00, 0x1F]);
* var tagId = readVariableInt(tagHeader, 4, 0);
* console.log('The current tag ID is: ', tagId.value, ', skipping ', tagId.size, ' bytes.');
* // The current tag ID is: 172351395, skipping 4 bytes.
@subfuzion
subfuzion / curl.md
Last active April 17, 2024 04:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@curtismcmullan
curtismcmullan / setup_selenium.sh
Last active May 2, 2023 22:56
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@wolfeidau
wolfeidau / sass_converter.rb
Created May 7, 2011 02:43
Sass plugin for Jekyll
module Jekyll
# Sass plugin to convert .scss to .css
#
# Note: This is configured to use the new css like syntax available in sass.
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.