Skip to content

Instantly share code, notes, and snippets.

View geoffoliver's full-sized avatar

Geoff Oliver geoffoliver

View GitHub Profile
// ==UserScript==
// @name Remove bullshit from sites
// @version 1
// @grant none
// @include https://gizmodo.com/*
// @include https://engadget.com/*
// @include https://www.engadget.com/*
// @include https://lifehacker.com/*
// @include https://jalopnik.com/*
// @include https://www.avclub.com/*
@geoffoliver
geoffoliver / ts-to-mp4.sh
Last active March 20, 2022 22:49
Convert .ts files to mp4 files with ffmpeg on MacOS
#!/bin/zsh
echo "Searching $1 for unconverted files"
for f in $1/**/*.ts; do
FILENAME=`basename "$f"`
OUTFILE=`echo "$FILENAME" | sed -e "s/\.ts/\.mp4/g"`
FULLPATH=`echo "$f" | sed -e "s/$FILENAME/$OUTFILE/g"`
if [ -f "$FULLPATH" ]; then
echo "File \"$OUTFILE\" exists, skipping conversion"
@geoffoliver
geoffoliver / slack-theme
Created November 6, 2017 21:01
My slack theme
#282828,#000000,#000000,#ADF26C,#5C6380,#FFFFFF,#ADF26C,#FF0100
@geoffoliver
geoffoliver / shell-output.txt
Last active May 22, 2016 20:20
Cake bake migration failure
vagrant@scotchbox:/var/www/public$ ls
bin composer.json config index.php package.json plugins src tmp vendor
bower.json composer.lock gulpfile.js logs phpunit.xml.dist README.md tests Vagrantfile webroot
vagrant@scotchbox:/var/www/public$ bin/cake bake migration CreateUsers id:uuid:primary name:string email:string:unique password:string reset_hash:string[32] role:string[20] created modified deleted:datetime
Error: Too many arguments.
Bake migration class.
Usage:
cake bake.bake migration [options] <name>
// In PHP
<?
public function some_func(){
$this->set(array(
'username'=>'TheUsername',
'_serialize'=>array('username')
));
}
?>
var gulp = require('gulp'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
@geoffoliver
geoffoliver / agi.php
Created December 4, 2013 09:17
PHP AGI for CakePHP Just use this instead of phpagi-fastagi.php... Probably have to make some tweaks to paths, but otherwise should work nicely with cake shells... Call it like agi://server.address/shell_name
#!/usr/bin/php -q
<?php
require_once(dirname(__FILE__).'/../Vendor/PHPAGI/PHPAGI.php');
$fastagi = new PHPAGI();
//$fastagi->verbose(print_r($fastagi, true));
if(!isset($fastagi->config['fastagi']['basedir'])){
$fastagi->config['fastagi']['basedir'] = dirname(__FILE__);
<?
/**
* Emailer script
*
* @author Geoff Oliver <[email protected]> for Fourthdoor Creative
* @date 03.20.2008
* @version .01
*/
if($_POST){
@geoffoliver
geoffoliver / cleanup.php
Last active December 26, 2015 19:39
Video download folder cleanup
<?
$cleanupDir = '/path/to/download/folder/';
$movieDir = '/path/to/movies/folder/';
$tvDir = '/path/to/tv/shows/folder/';
$tvNetworks = array(
'PBS',
'BBC','History','Discovery','DC'=>array('Discovery')
);