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 / 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 / import_xml_to_dataframe_to_sql.py
Created Jan 8, 2018
Python: Import XML to Pandas dataframe, and then dataframe to Sqlite database
View import_xml_to_dataframe_to_sql.py
import xml.etree.ElementTree as ET
import pandas as pd
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
# do this if running in jupyter
# pd.set_option('display.max_columns', None)
# convert XML to dataframe (assumes only one layer of nesting)
def xml2df(xml_data):
@mattmc3
mattmc3 / tasks.json
Created Apr 6, 2017
VSCode tasks for running a Makefile
View tasks.json
// Makefile
// ${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",
"command": "bash",
@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>
@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
You can’t perform that action at this time.