Skip to content

Instantly share code, notes, and snippets.

@olivierroy
olivierroy / move-windows.rb
Created April 9, 2024 04:36
Save and restore workspace positions in linux
#!/usr/bin/env ruby
# Usage:
# cmd: move-windows.rb save
# to save current windows workspaces to a move-windows.save file
# cmd: move-windows.rb
# to adjust windows workspaces according to the positions in the saved file
location = File.dirname(__FILE__)
save_filepath = "#{location}/move-windows.save"
@olivierroy
olivierroy / gmail_stats.rb
Created April 6, 2020 19:53
Gmail mbox parser to find what is using your space
# This program parses an mbox file from Google Takeout to identify the senders and subjects lines that use the most space in a Gmail account
# Disclaimer: sizes or message detection may not be accurate, takes a few minutes for a 30GB file
# Usage: ruby gmail_stats.rb filename.mbox
# keep track of totals
$senders = {}
$subjects = {}
$labels = {}
@olivierroy
olivierroy / payza_m.php
Last active March 27, 2020 13:44
Payza payment option for PancakeApp (system/pancake/modules/gateways/models/payza_m.php)
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* The Payza Gateway
*
* @subpackage Gateway
* @category Payments
*/