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 / fish_string.md
Last active Oct 20, 2019
ZSH - string functions
View fish_string.md

fish string utility

string - manipulate strings

Synopsis
   string escape [(-n | --no-quoted)] [--style=xxx] [STRING...]
   string join [(-q | --quiet)] SEP [STRING...]
   string join0 [(-q | --quiet)] [STRING...]
   string length [(-q | --quiet)] [STRING...]
@mattmc3
mattmc3 / .zshrc
Created Oct 17, 2019
zsh: example of zgen + oh-my-zsh setup
View .zshrc
# .zshrc
# setup zgen
export ZGEN_DIR="${ZDOTDIR:-$HOME}"/.zgen
[[ -d "$ZGEN_DIR" ]] || git clone https://github.com/tarjoilija/zgen.git --depth=1 "$ZGEN_DIR"
ZGEN_RESET_ON_CHANGE=(
${ZDOTDIR:-$HOME}/.zshrc
${ZDOTDIR:-$HOME}/zsh_plugins
)
# decide if you want to do compinit yourself
# ZGEN_AUTOLOAD_COMPINIT=false
@mattmc3
mattmc3 / zstyle_examples.zsh
Last active Oct 15, 2019
zsh: zstyle examples
View zstyle_examples.zsh
# reference: http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fzutil-Module
# https://unix.stackexchange.com/questions/214657/what-does-zstyle-do
# list all zstyle settings
zstyle -L
# set a string value
zstyle :example:favorites fruit apple
# set an explicit string value
@mattmc3
mattmc3 / csv_to_yaml.py
Last active Sep 30, 2019
Python: csv examples
View csv_to_yaml.py
#!/usr/bin/env python3
import yaml
import csv
data = []
with open('data.csv', 'r') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
header=next(csv_reader)
for row in csv_reader:
@mattmc3
mattmc3 / tasks.json
Created Apr 6, 2017
VSCode tasks for Golang
View tasks.json
// See http://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// ${workspaceRoot} the path of the folder opened in VS Code
// ${file} the current opened file
// ${fileBasename} the current opened file's basename
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "0.1.0",
@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.
View just-use-sublime.html
<header>
<h1 class="entry-title">Just Use Sublime Text</h1>
<p class="meta">
<time datetime="2013-03-16T19:06:00-07:00" pubdate="" data-updated="true">Mar 16<span>th</span>, 2013</time>
</p>
</header>
You can’t perform that action at this time.