Skip to content

Instantly share code, notes, and snippets.

View armadillu's full-sized avatar

Oriol Ferrer Mesià armadillu

View GitHub Profile
@armadillu
armadillu / print256colours.sh
Created February 14, 2022 06:37 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@armadillu
armadillu / copy-path-to-clipboard.scpt
Last active December 22, 2015 21:09 — forked from kitschpatrol/copy-path-to-clipboard.scpt
takes selected item from frontmost finder window, makes a smb:// link to the file and copies it into the clipboard Just go an paste it into your email! Whoever clicks on that link, will be automatically connected to that server and directed to that file. It also bypasses login window. Only for LP people!
-- csipttc_unisiwc_ctpttfwttc.app
-- Copy Selected Items Path To The Clipboard Unless Nothing Is Selected In Which Case Copy The Path To The Foremost Window To The Clipboard
on makeAndCopyLinkFromPath(myPath)
if myPath starts with "/Volumes/" then
set dirStructure to ((characters 9 thru -1 of myPath) as string)
set strHTML to quoted form of ("<a style='font-family:helvetica' href=\"smb://Guest::@lp-vault" & dirStructure & "\">" & myPath & "</a>") --double :: bc otherwise it disappears?
--tell application "Finder" to display dialog strHTML
do shell script "echo " & strHTML & " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
else