Skip to content

Instantly share code, notes, and snippets.

View mattmc3's full-sized avatar
🐍
Python!

mattmc3 mattmc3

🐍
Python!
View GitHub Profile
@mattmc3
mattmc3 / hello.go
Created April 5, 2017 23:55
Golang Hello World
package main
import (
"fmt"
"log"
)
func check(err error) {
if err != nil {
log.Fatal(err)
@mattmc3
mattmc3 / sort_map.go
Last active April 5, 2017 23:57
Golang sort map keys
keys := make([]string, len(m))
i := 0
for k := range m {
keys[i] = k
i++
}
sort.Strings(keys)
@mattmc3
mattmc3 / main.html
Created April 6, 2017 00:07
HTML template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5</title>
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
<p>Hello</p>
@mattmc3
mattmc3 / theme.slack
Created April 6, 2017 00:16
Slack JuiceBar theme
http://slackthemes.net/#/juice_bar
#86A34E ,#94AF63 ,#FFFFFF ,#6D8B42 ,#94AF63 ,#FFFFFF ,#FFB10A ,#DFA044
@mattmc3
mattmc3 / plaintasks.txt
Created April 6, 2017 00:34
Sublime Text PlainTasks Template
# Sublime PlainTasks https://github.com/aziz/PlainTasks
# ⌘-i : Add new task
# ⌘-[enter] : Add new task (alt)
# ⌘-d : Mark task done
# ⌘-[shift]-a : Archive completed tasks
# ⌘-[shift]-u : Open URL
# ⌘-r : Show projects
# [ctrl]-c : Cancel task
# [tab] : Insert date when between parens
#
@mattmc3
mattmc3 / .editorconfig
Created April 6, 2017 00:35
EditorConfig template
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@mattmc3
mattmc3 / pg_dump_schema.sh
Created April 6, 2017 00:38
Postgres dump schema
# Dump a schema to a .sql file
pg_dump -U postgres -s {{db}} > {{db}}.sql
@mattmc3
mattmc3 / django_secret_key.py
Created April 6, 2017 00:40
Django make new secret key
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
get_random_string(50, chars)
@mattmc3
mattmc3 / tasks.json
Created April 6, 2017 00:43
VSCode tasks for Python 3
// # Be sure to set up virtualenv
// python3 -m venv .env
// source .env/bin/activate
// pip install --upgrade pip
// pip freeze > requirements.txt
//
// ${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
@mattmc3
mattmc3 / drop_tbl.sql
Created April 6, 2017 00:49
MSSQL drop table if exists
if object_id('{{schema}}.{{table}}') is not null drop table {{schema}}.{{table}}