Skip to content

Instantly share code, notes, and snippets.

@alecs
alecs / delete.gs
Last active September 6, 2024 13:42
gmail - delete emails in threads
function dothedew() {
emptyGmail();
deleteTrashEmailsPermanently();
}
function emptyGmail() {
var mymail = "me@email.com";
var labels = ['INBOX', 'Archive/CSV', 'Archive/Purchase', 'Builder', 'Junk', 'Logwatches', 'MySQL', 'Notes' ]; // Add your labels here
labels.forEach(function(label) {
var pageToken;
@alecs
alecs / gist:4bde29ba8a28f82c02cd78a7423f2052
Created December 5, 2024 16:45
symfony v2 dump all params
<?php
use Symfony\Component\HttpFoundation\Request;
// Bootstrap the Symfony environment
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
@alecs
alecs / symonfy-v6-ses-mail-test.php
Created January 8, 2026 15:33
symfony v6 aws ses mailing
<?php
// test-ses.php
// Require Composer's autoloader
require_once __DIR__ . '/vendor/autoload.php';
// Import AWS SES classes
use AsyncAws\Ses\SesClient;
use AsyncAws\Ses\Input\SendEmailRequest;
use AsyncAws\Ses\ValueObject\Destination;
@alecs
alecs / sfs3.php
Last active January 15, 2026 12:54
symfony v2 s3
<?php
// s3_operations.php
// Bootstrap the Symfony environment
require_once __DIR__ . '/app/bootstrap.php.cache';
require_once __DIR__ . '/app/AppKernel.php';
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Aws\S3\S3Client;
<div id="jitsi-container" style="height: 80vh; width: 100%;"></div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const domain = "jitsi.member.fsf.org";
const urlParams = new URLSearchParams(window.location.search);
var roomName = urlParams.get('room') || 'the-meet';
roomName = roomName.replace(/[^a-zA-Z0-9_-]/g, '');
@alecs
alecs / wgroutes.sh
Created May 25, 2026 14:55
wireguard extra routing for existing tunnel, without routing wildcard 0/0; good especially for hostnames that change destination, like cloudfront/aws-alb
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Error: Please run this script using sudo." >&2
exit 1
fi
MY_IP=""
ROUTED_IPS=""