Skip to content

Instantly share code, notes, and snippets.

@imthenachoman
imthenachoman / Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace.md
Last active September 5, 2024 15:34
Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace
@imthenachoman
imthenachoman / 00 README.md
Last active July 23, 2024 18:16
Debian snapper apt script to include full apt command including arguments as snapshot description

This gist includes an enhancement to Debian's snapper package.

The current (as of 2023-07-23) snapper package includes an apt configuration that will automatically take snapper snapshots when you use apt to install/remove/etc. It will add use "apt" as the description of the pre/post snapshot.

With the below changes to the /etc/apt/apt.conf.d/80snapper file and associated dpkg-pre-post-snapper.sh file, snapper will include the full apt command, including the arguments, in the snapshot description.

For example:

$ sudo apt install funky
@imthenachoman
imthenachoman / README.md
Last active August 20, 2023 20:48
Bash script to open files with `kate` from the CLI and ask for `sudo` password if the current user does not have edit access to the file.

Overview

For whatever reason, openSUSE disables the polkit for Kate that will make it so Kate will prompt for a password when you try to edit root owned files.

The only way I could figure out how to get Kate to open these files is using the command VISUAL="kate -b" sudoedit <file>.

So I wrote a little helper script (to put be put in .bashrc) that opens kate for any file.

  • If the current user has write access to the file/folder, it'll open kate as the current user
  • If the current user does not have write access to the file/folder, it'll use sudoedit to open the file.
This file has been truncated, but you can view the full file.
May 17 14:41:51 desk systemd-journald[288]: Journal stopped
May 17 14:41:51 desk dnsmasq[840]: exiting on receipt of SIGTERM
May 17 14:41:51 desk systemd-journald[288]: Received SIGTERM from PID 1 (systemd-shutdow).
May 17 14:41:51 desk systemd-shutdown[1]: Sending SIGTERM to remaining processes...
May 17 14:41:51 desk systemd-shutdown[1]: Syncing filesystems and block devices.
May 17 14:41:51 desk systemd[1]: Shutting down.
May 17 14:41:51 desk systemd[1]: Reached target poweroff.target - System Power Off.
May 17 14:41:51 desk systemd[1]: Finished systemd-poweroff.service - System Power Off.
May 17 14:41:51 desk systemd[1]: systemd-poweroff.service: Deactivated successfully.
May 17 14:41:51 desk systemd[1]: Reached target final.target - Late Shutdown Services.
@imthenachoman
imthenachoman / BTT - Default.bttpreset
Last active October 20, 2022 04:00
macOS to Windows 10
{
"BTTPresetCreatorNotes" : "",
"BTTPresetInfoURL" : "https:\/\/gist.github.com\/imthenachoman\/2ffd196b8cc2603245cd5179e99e91d8",
"BTTPresetName" : "Default",
"BTTGeneralSettings" : {
"BTTPathSampleSize" : 100,
"BTTCMOnTop" : true,
"BTTForceForceClickPressure2F" : 700,
"BSTLeftHalfBlock" : true,
"BTTMinDrawingMovement" : 2,
@imthenachoman
imthenachoman / BofA and PNC Daily Balance Consolidator.js
Last active March 11, 2020 20:16
BofA and PNC daily balance e-mail consolidator with running tally
var dailyBankingHistoryGmailSearchQuery = '(from:(onlinebanking@ealerts.bankofamerica.com) subject:("Your Available Balance") "your available balance") OR (from:(pncalerts@pnc.com) subject:(("Your Credit Card Balance" AND -"Your Credit Card Balance Is") OR "Your Savings Account Balance" OR "Your Checking Account Balance"))';
var dailyBalanceDaysToKeep = 5;
function getDailyBankBalance()
{
// get all the emails
var emailThreads = GmailApp.search(dailyBankingHistoryGmailSearchQuery);
// if we have no mails then stop
if(!emailThreads.length) return;
@imthenachoman
imthenachoman / keybase.md
Created December 8, 2019 03:56
keybase.md

Keybase proof

I hereby claim:

  • I am imthenachoman on github.
  • I am imthenachoman (https://keybase.io/imthenachoman) on keybase.
  • I have a public key whose fingerprint is 44EC 4F75 2238 9751 A658 C802 4A5E 04FD 2EA2 32D7

To claim this, I am signing this object:

@imthenachoman
imthenachoman / README.rst
Last active July 26, 2023 05:47 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as

@imthenachoman
imthenachoman / getContactDates.js
Created September 21, 2017 03:30
gets all dates (like birthdays and anniversaries) from Google Contacts and sends an e-mail with their details
var EMAIL_TO = "...@gmail.com";
var NUM_ADDITIONAL_DAYS = 8;
var TODAY = new Date((new Date()).toDateString());
var ONE_DAY = 24*60*60*1000;
function getContactDates()
{
var todayYear = TODAY.getFullYear();
var todayNumber = TODAY.getTime();
// date we want to go back to for previous dates
@imthenachoman
imthenachoman / unlike.js
Last active August 29, 2017 14:07
JavaScript snippet to unlike all your liked activity on FaceBook
function startIt()
{
document.querySelectorAll(".mrs._2fmu.img.sp_XaQA31b2wGR_2x.sx_06c0ed")[0].click();
setTimeout(function()
{
[].slice.call(document.querySelectorAll("a[rel='async-post'][role='menuitem']")).pop().click();
setTimeout(startIt, 2000);
}, 1000);
}