Skip to content

Instantly share code, notes, and snippets.

# Serve .vtt files with Access-Control-Allow-Origin: * header if referer is the correct domain
<IfModule mod_setenvif.c>
<FilesMatch "\.vtt$">
SetEnvIf Referer "^http(s)?://(.+\.)?somedomain\.com/" VALID_REFERER=$1
Header set Access-Control-Allow-Origin "*" env=VALID_REFERER
</FilesMatch>
</IfModule>
You could also use origin
<?php
chdir('..');
$output = array();
exec('git log -15 --pretty=format:"%ad %an %s" --abbrev-commit --date=short', $output);
$history = array();
foreach ($output as $line) {
$commit = array();
@TomA-R
TomA-R / bongo.sh
Last active December 24, 2015 10:59 — forked from jmoiron/bongo.sh
#!/bin/bash
LOADING=false
while [ $# -gt 0 ] ; do
case "$1" in
-h|--help)
echo "usage: $package [options] dbname"
echo " "
echo "OPTIONS:"
<?php
// Clean argument values
$phpStormRunner = null;
$cleanedArgv = array();
foreach ($_SERVER['argv'] as $key => $value) {
if (strpos($value, 'ide-phpunit.php') === false) {
$cleanedArgv[] = $value;
} else {
$phpStormRunner = $value;
}