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 / hello.go
Created Apr 5, 2017
Golang Hello World
View hello.go
package main
import (
"fmt"
"log"
)
func check(err error) {
if err != nil {
log.Fatal(err)
@mattmc3
mattmc3 / sort_map.go
Last active Apr 5, 2017
Golang sort map keys
View sort_map.go
keys := make([]string, len(m))
i := 0
for k := range m {
keys[i] = k
i++
}
sort.Strings(keys)
View main.html
<!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 Apr 6, 2017
Slack JuiceBar theme
View theme.slack
http://slackthemes.net/#/juice_bar
#86A34E ,#94AF63 ,#FFFFFF ,#6D8B42 ,#94AF63 ,#FFFFFF ,#FFB10A ,#DFA044
@mattmc3
mattmc3 / plaintasks.txt
Created Apr 6, 2017
Sublime Text PlainTasks Template
View plaintasks.txt
# 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 Apr 6, 2017
EditorConfig template
View .editorconfig
# 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 Apr 6, 2017
Postgres dump schema
View pg_dump_schema.sh
# Dump a schema to a .sql file
pg_dump -U postgres -s {{db}} > {{db}}.sql
@mattmc3
mattmc3 / django_secret_key.py
Created Apr 6, 2017
Django make new secret key
View django_secret_key.py
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
get_random_string(50, chars)
@mattmc3
mattmc3 / tasks.json
Created Apr 6, 2017
VSCode tasks for Python 3
View tasks.json
// # 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 Apr 6, 2017
MSSQL drop table if exists
View drop_tbl.sql
if object_id('{{schema}}.{{table}}') is not null drop table {{schema}}.{{table}}
You can’t perform that action at this time.