Skip to content

Instantly share code, notes, and snippets.

View gizmola's full-sized avatar

David Rolston gizmola

View GitHub Profile
@gizmola
gizmola / batch-delete-gmail-emails.js
Created December 1, 2021 08:27 — forked from gene1wood/batch-delete-gmail-emails.js
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
/*
This script, when used with Google Apps Scripts will delete 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 threads. This limits to 400 threads in case 500
threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete
@gizmola
gizmola / RegenerateAppSecretCommand.php
Last active November 20, 2021 08:36
A Symfony4/Symfony5 Command script that adds ability to set APP_SECRET in either .env or .env.local files.
<?php
namespace App\Command;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
@gizmola
gizmola / gist:369a85ea96836abd3041
Created September 4, 2014 18:07
Get list of largest files in a git repo from bash
git rev-list master | while read rev; do git ls-tree -lr $rev | cut -c54- | grep -v '^ '; done | sort -u | perl -e '
while (<>) {
chomp;
@stuff=split("\t");
$sums{$stuff[1]} += $stuff[0];
}
"$sums{$_} $_\n" for (keys %sums);
' | sort -rn >> large_files.txt
@gizmola
gizmola / ex-ffmpeg.php
Created May 23, 2013 20:34
php--ffmpeg skeleton
<?php
$ffmpeg
->setthreads(2)
->setProber($ffprober)
->setTimeout(3600);
echo 'ffmpeg timeout set to: ' . $ffmpeg->getTimeout() . "\n";
$x264->setResizeMode(X264::RESIZEMODE_SCALE_WIDTH)
->setDimensions(1, $targetheight)
@gizmola
gizmola / nginx.conf
Created December 14, 2012 02:21 — forked from leon/nginx.conf
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {