Skip to content

Instantly share code, notes, and snippets.

View christopheranderton's full-sized avatar

Christopher Anderton christopheranderton

View GitHub Profile
@dagheyman
dagheyman / .vmx
Last active April 28, 2020 11:49
VMWare Fusion - USB passthrough for YubiKeys (make sure to use USB 2.0)
usb.generic.allowHID = "TRUE
usb.generic.allowLastHID = "TRUE"
@RebeccaWhit3
RebeccaWhit3 / Keyboard HTML Tag for Github Markdown.md
Created March 14, 2017 02:12
Keyboard HTML Tag for Github Markdown

Keyboard HTML Tag for Github Markdown

Examples:

control + shift + space

command/control + ,

👆/👇/👈/👉

@dardo82
dardo82 / ch-dirs-icons.sh
Last active August 3, 2019 01:26
Change folders icons
#!/bin/sh
cd $1; convert 'xc:none[1024x1024]' folder.png; folderify -x 10.8 folder.png
mv folder.iconset/icon_512x512\@2x.png .; rm -frv folder.{ic{,o}ns{,et},png}
find $1 -name Icon^M; cd $dir; icns2png -x -s 1024 Icon^M
convert -transparent white <(compare -fuzz 16% Icon^M_1024x1024x32.png \
$1/icon_512x512\@2x.png -compose src -highlight-color black png:) logo.png
folderify logo.png .; chflags hidden ./Icon^M; rm logo.png
@dardo82
dardo82 / fb-ph-dl.sh
Last active September 24, 2017 09:28
FaceBook photo DL
#!/bin/bash
shopt -s expand_aliases; fb=https://m.facebook.com; open $fb/$1/photos; sleep 10
function safari-cli { eval osascript -e \'tell application \"Safari\" to $1\'; }
alias sst='safari-cli "get source of current tab of front window"'
alias sct='safari-cli "close current tab of front window"'
sst | tr \" \\n | grep ^/.*42$ | cut -d\& -f1 | xargs -I {} open $fb{}; sleep 10
mkdir $1; cd $1; for page in {01..40}; do URL=$(sst | tr \" \\n | grep -B1 Size\
| sed -E "s/amp;|\\\//g;q"); curl -v -o $(basename ${URL%\?*}) "$URL"; sct; done
@ngobach
ngobach / optimize-vmware.md
Last active December 15, 2017 14:08 — forked from wpivotto/gist:3993502
Maximize VMWare images performance

optimize-vmware

Insert the following code into the *.VMX file:

sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"
# This file is executed for login shells
# minimalist prompt string
export PS1="$ "
# set the editor of choice
# [VISUAL vs. EDITOR](https://unix.stackexchange.com/questions/4859/visual-vs-editor-whats-the-difference)
export VISUAL=nano
export EDITOR="$VISUAL"
@zmwangx
zmwangx / # macOS 10.12.2 default fonts.md
Last active December 21, 2019 09:21
macOS 10.12.2 default fonts

See script for details of each file.

Apple Support article Fonts included with macOS Sierra is also a good resource, but it is fairly confusing in certain ways, e.g. Songti SC is listed both under fonts that are "installed and enabled automatically by macOS Sierra" and that are "available for download in macOS Sierra" (Update. I checked macOS 10.12 and Songti SC has been there all along).

There is also a seemingly very informative article, Font Management in macOS and OS X by Kurt Lang, which I found via Google Search. This is where I found out about the new directory /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/Resources/FontInfo in macOS Sierra which has replaced Stub Fonts in Font Book.app.

@monomadic
monomadic / mac.sh
Last active August 10, 2022 04:50
Forked from another file and documented, each entry on a new line to provide easy commenting / disabling of lines.
#!/bin/bash
# PRO TIP: Don't disable shit until you know exactly what it does. Remember that disabling doesn't kill the process, so most tweaks you need to reboot to fully see effects.
# MINI TUTORIAL ON LAUNCHCTL
# List all jobs in system:
# launchctl list
# first column is the process id, or - if the job is not loaded. second is exit code.
@SethCalkins
SethCalkins / LittleSnitch_Block_List.md
Last active January 5, 2023 05:17
Little Snitch Script to block Ad Servers

Here is a script to take the hosts from From http://pgl.yoyo.org/adservers/ and convert them to rules for Little Snitch.

It has options to grab the entire list or grab new entries past a certain date.

Just grab the output and copy/paste into Little Snitch.

The script is written to block access to any process, any port. You can also delete those lines and it will only block Mail. Or use the options to enter any process, port or protocol you want to block.

@peterwooley
peterwooley / translate.applescript
Created November 2, 2016 17:37
Run this AppleScript in an Automator service to open selected text in Google Translate.
-- Modified from http://scriptingosx.com/2016/01/build-a-google-translate-service/
on run {input, parameters}
set theText to input as string
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return & linefeed, return, linefeed, "
", character id 8233, character id 8232}
-- list of line break chars from http://stackoverflow.com/questions/12546253/how-to-replace-n-in-applescript#12546965
set splitText to text items of theText
set AppleScript's text item delimiters to {space}
set theText to splitText as text