Skip to content

Instantly share code, notes, and snippets.

View mava's full-sized avatar

Marco Varisco mava

View GitHub Profile
@mava
mava / .latexmkrc
Last active December 19, 2023 22:24
latexmkrc
# Set standard engine to pdflatex
$pdf_mode = 1;
# 0 —> no pdf
# 1 —> pdflatex
# 2 —> ps2pdf
# 3 —> dvipdf
# 4 —> lualatex
# 5 —> xelatex & xdvipdfmx
# Enable system commands via \write18{...}
@monkeydom
monkeydom / ks_changeset.sh
Created May 3, 2022 08:13
Script to put 2 folders into a single changeset git and diff it using ksdiff to see the changeset nicely
#!/bin/sh
# ks_changeset v0.9 - 2022-05-03
# Enable "safe" mode - see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
if [[ $# -lt 3 ]]; then
echo "Usage: ks_changeset.sh <FolderA> <FolderB> <DestinationGit>"
@simonw
simonw / how-to.md
Last active March 26, 2024 23:21
How to create a tarball of a git repository using "git archive"
#!/usr/bin/perl
# This filter changes all words to Title Caps, and attempts to be clever
# about *un*capitalizing small words like a/an/the in the input.
#
# The list of "small words" which are not capped comes from
# the New York Times Manual of Style, plus 'vs' and 'v'.
#
# 10 May 2008
# Original version by John Gruber:
@gruber
gruber / Paste URL From Safari Tab.scpt
Created June 29, 2015 00:01
Paste URL From Safari Tabs
set _old_delims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {""}
tell application "System Events"
set _current_app to name of the first process whose frontmost is true
end tell
tell application "Safari"
set _urls to {}
repeat with i from 1 to 6 -- how many Safari windows to show URLs from
@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2024 19:02
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@redsweater
redsweater / SwitchProfile
Created October 12, 2011 15:35
If you use ScanSnap, you can have GUI Scripting automate the process of switching among your scan profiles ...
-- Launches ScanSnap Manager, if necessary. Opens the ScanSnap Manager settings window,
-- changes to named profile, applies changes, and closes the window
-- Example:
SwitchToProfile("Standard")
on SaveActiveApplication()
return application
end SaveActiveApplication
on OpenOptionsWindow()
@gfontenot
gfontenot / Open Page In Chrome.scpt
Created March 14, 2011 16:52
Open the current Safari page in Google Chrome
tell application "Safari"
set the_url to URL of front document
end tell
tell application "Google Chrome"
try
set win to first window
on error
set win to make new window
end try
#!/usr/bin/perl
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs
# License: See below.
# http://gist.github.com/507356
use strict;
use warnings;
use URI::Escape;