Skip to content

Instantly share code, notes, and snippets.

View jonathands's full-sized avatar
🏠
Working from home

Jonathan DS jonathands

🏠
Working from home
View GitHub Profile
@jonathands
jonathands / README.md
Created September 20, 2024 12:59 — forked from dpaluy/README.md
Download view only protected PDF from Google Drive

Step by step guide to downloading protected PDF from Google Drive

  1. Open the document in Google Docs
  2. Scroll to the bottom of the document, so all the pages are present
  3. Open Developer Tools on separate window and choose the Console tab
  4. Paste the code
  5. Have fun!
@jonathands
jonathands / gmail-stats.gs
Created June 24, 2023 12:23 — forked from leodevbro/gmail-stats.gs
In Gmail inbox, Find sender with most mail threads
// Original script: https://gist.github.com/leodevbro/2987e8874a18b2086ea6cc1aa3c494e8
// v2.5
// Google Apps Script is a coding language based on JavaScript.
// This Apps Script code helps us to sort addresses by most threads.
// A thread is a group of messages, as a conversation.
const modes = {
inbox: "inbox", // to analyze threads in the "Inbox" folder
outbox: "outbox", // to analyze threads in the "Sent" folder
@jonathands
jonathands / simple_curl.php
Created November 28, 2022 11:34 — forked from ViliamKopecky/simple_curl.php
Simple cURL wrapper function for GET, POST, PUT & DELETE methods
/**
* Wrapper for easy cURLing
*
* @author Viliam Kopecký
*
* @param string HTTP method (GET|POST|PUT|DELETE)
* @param string URI
* @param mixed content for POST and PUT methods
* @param array headers
* @param array curl options
@jonathands
jonathands / autopgsqlbackup
Created June 8, 2020 01:41 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <[email protected]>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@jonathands
jonathands / glog
Last active June 2, 2020 13:00 — forked from metrofx/glog
Pretty git log, displays 20 last commits.
#!/bin/sh
git --no-pager log -n 20 --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
@jonathands
jonathands / vhost.sh
Created May 28, 2020 21:46 — forked from Adamwaheed/vhost.sh
Simple Apache Vhost manager
#!/bin/bash
NONE='\033[00m'
RED='\033[01;31m'
GREEN='\033[01;32m'
YELLOW='\033[01;33m'
PURPLE='\033[01;35m'
CYAN='\033[01;36m'
WHITE='\033[01;37m'
BOLD='\033[1m'