Skip to content

Instantly share code, notes, and snippets.

View chrisgrieser's full-sized avatar

Chris Grieser chrisgrieser

View GitHub Profile
@stefanschmidt
stefanschmidt / remove-annotations.sh
Last active February 1, 2024 17:01
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active May 22, 2024 11:01
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@vitorgalvao
vitorgalvao / Right Click.applescript
Last active March 16, 2023 14:30
Make right-clicking on OSX accessible via a keyboard shortcut
(*
A [native solution][1] exists but it suffers from a major flaw: it right-clicks where the cursor is, not what on the selection.
This code addresses that limitation, though it only works on Finder windows and not the Desktop.
You can install it as a [Finder Service, and later asign it a keyboard shortcut][2].
[1]: http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os
[2]: http://www.macosxautomation.com/services/learn/tut01/index.html
*)
@ellcom
ellcom / AppleScript.Spotify.PlayPause.scpt
Created August 2, 2014 17:02
Tell spotify to play/pause using AppleScript
using terms from application "Spotify"
if player state of application "Spotify" is paused then
tell application "Spotify" to play
else
tell application "Spotify" to pause
end if
end using terms from
@dtinth
dtinth / README.md
Last active May 11, 2024 02:21
Batch File Rename Script

Batch File Rename

Use JavaScript for Automation to rename files in batch!

Motivation

@flbuddymooreiv
flbuddymooreiv / passgitgpg.md
Last active May 17, 2024 02:54
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@scemama
scemama / get_bibtex.sh
Last active November 22, 2021 18:59 — forked from TApplencourt/get_bibtex.sh
Gets a bibtex file from a DOI or an ISBN
#!/bin/bash
str_utilisation="$0 (doi|isbn) <value>"
if [ "$#" -ne 2 ];then
echo ${str_utilisation}
exit 1
fi
if [ "$1" == "doi" ];then
@nepsilon
nepsilon / bash-zsh-useful-aliases.md
Last active December 25, 2021 08:20
Useful aliases for bash and zsh — First published in fullweb.io issue #17

Useful aliases for bash and zsh

Using aliases to give commands useful options by default is a good way to boost productivity.

Here are 5 aliases to put in your ~/.bashrc or ~/.zshrc to keep them permanently:

1. ls:

# ls: adding colors, verbose listign
# and humanize the file sizes:
@samyk
samyk / chrome_tabs.osa
Created June 14, 2016 18:36
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
# shows all url+titles of Chrome along with front window+tab url+title
set titleString to ""
tell application "Google Chrome"
set window_list to every window # get the windows
repeat with the_window in window_list # for every window
set tab_list to every tab in the_window # get the tabs
repeat with the_tab in tab_list # for every tab