Skip to content

Instantly share code, notes, and snippets.

View jhult's full-sized avatar

Jonathan Hult jhult

View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active April 16, 2024 14:46
Modifying Revisions of a File on Google Drive using Google Apps Script

Modifying Revisions of a File on Google Drive using Google Apps Script

This is a sample script for modifying the revisions of a file on Google Drive using Google Apps Script. This script can be used for not only Google Docs files, but also the files except for Google Docs.

Issue and workaround:

Unfortunately, in the current stage, at Google Docs files, the revision of Google Docs cannot be directly changed by APIs with a script. So as one of several workarounds, I would like to propose to overwrite the Google Docs file using the exported data. On the other hand, at the files except for Google Docs, the data can be directly retrieved with the revision ID. This can be used for overwriting the file. The flow of this script is as follows.

For Google Docs files:

@tehmoon
tehmoon / iptables-reload.sh
Last active November 24, 2024 11:38
IPtables and docker reload!
#!/bin/sh
set -e
## SEE https://medium.com/@ebuschini/iptables-and-docker-95e2496f0b45
## You need to add rules in DOCKER-BLOCK AND INPUT for traffic that does not go to a container.
## You only need to add one rule if the traffic goes to the container
CWD=$(cd "$(dirname "${0}")"; pwd -P)
FILE="${CWD}/$(basename "${0}")"
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active June 3, 2025 04:12
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@jefflombard
jefflombard / ag_replace.sh
Last active October 12, 2021 13:36
agr command - Find and Replace with ag on Mac OSX
#!/bin/sh
agr () {
# find and replace
regex=s/${1}/${2}/g;
ag $1 -l | xargs sed -i.agr_backup $regex;
# delete backups
ag -G .agr_backup -l | xargs rm
}
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active June 3, 2025 00:40
set -e, -u, -o, -x pipefail explanation
@lokimeyburg
lokimeyburg / pm-interview-questions.md
Last active May 11, 2025 07:10
Product Manager Interview Questions

Product Manager Interview Questions

General Questions:

  • Tell me about yourself.
  • Tell me about the most boring job you have ever had.
  • What changes would you make if you came on board?
  • What would you say to your boss if he is crazy about an idea, but you think it stinks?
  • Assuming that you are selected, what will be your strategy for next 60 days?
  • why are not you earning more money at this stage of your career?

Technical details for https://stackoverflow.com/a/44169445/6730571

Details of investigation:

On a base system, /usr/bin/java is a symlink that points to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, which is an Apple wrapper tool that locates and executes the actual java.

(Do not touch anything in those 2 system directories. It should actually be impossible due to "System Integrity Protection" anyway.)

If you don't have Java installed, attempting to execute java will open a dialog that invites you to install it.

@loisaidasam
loisaidasam / README.md
Last active May 30, 2024 20:45
Scraped Mitch Hedberg jokes
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 17, 2025 22:13
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links