Skip to content

Instantly share code, notes, and snippets.

🐍
Python!

mattmc3 mattmc3

🐍
Python!
Block or report user

Report or block mattmc3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mattmc3
mattmc3 / shortcuts.md
Last active Aug 8, 2019
Mac Keyboard Shortcuts
View shortcuts.md
Shortcut English Computerese
new line insertNewline:
⌥ ↩ new line (don't leave form box)[1] insertNewlineIgnoringFieldEditor:
new line insertNewline:
⌥ ⌅ new line (don't leave form box)[1] insertNewlineIgnoringFieldEditor:
tab insertTab:
⌥ ⇥ tab (don't leave form box)[1] insertTabIgnoringFieldEditor:
backtab insertBacktab:
⌘ space cha
@mattmc3
mattmc3 / DefaultKeyBinding.dict
Created Aug 3, 2019 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
View DefaultKeyBinding.dict
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@mattmc3
mattmc3 / .zshrc
Created Jul 29, 2019
ZSH: grml zsh config
View .zshrc
# http://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/zsh/zshrc;hb=HEAD
# Filename: /etc/zsh/zshrc
# Purpose: config file for zsh (z shell)
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
@mattmc3
mattmc3 / gist-backup.py
Last active Jul 28, 2019 — forked from fedir/gist-backup.py
Clone or update all user's gists #backup #github #gists #management
View gist-backup.py
#!/usr/bin/env python
# Clone or update all a user's gists
# curl -LJO https://gist.githubusercontent.com/mattmc3/b9f314f29add32330b2ee359e2ad5aba/raw/0068945bf19bc50b9847d5938286c74953aa97e3/gist-backup.py
# chmod 755 ./gist-backup.py
# USER=mattmc3 python3 gist-backup.py
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import urllib
from subprocess import call
@mattmc3
mattmc3 / test_bash_or_zsh.sh
Created Jul 27, 2019
Shell: test for bash or zsh
View test_bash_or_zsh.sh
if [ -n "$ZSH_VERSION" ]; then
# assume Zsh
elif [ -n "$BASH_VERSION" ]; then
# assume Bash
else
# asume something else
fi
@mattmc3
mattmc3 / source_me.sh
Last active Jul 27, 2019
Bash: get current script directory (zsh too)
View source_me.sh
# source this file
# https://stackoverflow.com/questions/9901210/bash-source0-equivalent-in-zsh
__main() {
local this_script="${BASH_SOURCE[0]:-${(%):-%x}}"
local this_dir="$(cd $(dirname "$this_script") && pwd)"
echo $this_script
echo $this_dir
}
__main
@mattmc3
mattmc3 / git_rm_submodule.sh
Created Jul 26, 2019
Git remove submodule
View git_rm_submodule.sh
# https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule/36593218#36593218
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
View list.txt
Classic Marcel
Quarter Marcel
Inverse Quarter Marcel
Inverse Marcel
Double Marcel
Inverse Double Marcel
Marcel Sandwich (not to be confused with the Dutch sandwich)
Double Marcel Sandwich
Double Irish Marcel
Double Irish with a Marcel Sandwich
@mattmc3
mattmc3 / .zshrc
Created Jun 19, 2019
ZSH: Antigen heredoc bundle example
View .zshrc
antigen use oh-my-zsh
# themes I like: refined, wezm, juanghurtado, avit, kardan, juanghurtado, steeef
antigen theme avit
antigen bundles <<EOBUNDLES
zsh-users/zsh-autosuggestions
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-history-substring-search
zsh-users/zsh-completions
@mattmc3
mattmc3 / myapp.rb
Created Apr 29, 2019
Homebrew - Tap for private repo
View myapp.rb
# Homebrew formula for private github repo
# Requires $HOMEBREW_GITHUB_API_TOKEN to be set
# WARNING: This is a cheap way to do this. Don't use this method unless you
# really don't care about the security of you private GH token. And, let's
# be clear - this is for a private GH Enterprise repo, so you might not
# care...
class MyApp < Formula
desc "My fake app"
You can’t perform that action at this time.