Skip to content

Instantly share code, notes, and snippets.

View pcewing's full-sized avatar

Paul Ewing pcewing

  • Blizzard Entertainment
View GitHub Profile
@pcewing
pcewing / long_pattern_match.ex
Last active June 18, 2016 05:03
Formatting a function definition with long pattern matching/guard clauses.
# A message is supposed to come in like this but we don't know if the fields are filled out.
message = %{
route: %{
destination: "Tim",
source: "Paul"
},
type: :friend_request,
payload: %{
size: 32,
content: %{
@pcewing
pcewing / times.exs
Last active July 10, 2016 22:35
Macro Question
# Exercise: MacrosAndCodeEvaluation-2
# Write a macro called *times_n* that takes a single numeric argument. It should define a function
# called *times_n* in the caller's module that itself takes a single argument, and that multiplies
# the argument by *n*. So, calling *times_n(3)* should create a function called *times_3*, and
# calling *times_3(4)* should return 12. Here's an example of it in use:
#
# defmodule Test do
# require Times
# Times.times_n(3)
# Times.times_n(4)
@pcewing
pcewing / learning_topics.yaml
Created July 13, 2016 18:16
Some things I want to learn about along with resources to do so.
Cloud:
OpenStack:
notes:
"OpenStack is definitely something I want to familiarize with."
- books:
- "OpenStack In Action"
Containerization:
Docker:
notes:
""
@pcewing
pcewing / xsnazzy
Created September 8, 2016 18:36
urxvt-snazzy
! special
*.foreground: #eff0eb
*.background: #282a36
*.cursorColor: #eff0eb
! black
*.color0: #282a36
*.color8: #686868
! red
! special
*.foreground: #839496
*.background: #002b36
*.cursorColor: #839496
! black
*.color0: #073642
*.color8: #002b36
! red
@pcewing
pcewing / VSControls.md
Last active November 29, 2016 23:56
Visual Studio Controls

Visual Studio Controls

This page acts as a way to document the shortcuts I like to configure when working in Visual Studio. I generally set these up with the primary goals being to eliminate any/all use of the mouse and to try to mirror my Vim controls as closely as possible. I use VsVim; however, the functionality doesn't make everything I'd like to do possible, such as setting <Space> as the leader key and running Visual Studio commands via chords. This is my attempt to pseudo-vimify the IDE.

Controls

@pcewing
pcewing / sway.log
Created October 25, 2017 16:17
Sway error log
I: 10/25/17 08:23:36 - [main.c:250] Linux pewing-vm003 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I: 10/25/17 08:23:36 - [main.c:222] Contents of /etc/lsb-release:
I: 10/25/17 08:23:36 - [main.c:229] DISTRIB_ID=Ubuntu
I: 10/25/17 08:23:36 - [main.c:229] DISTRIB_RELEASE=17.10
I: 10/25/17 08:23:36 - [main.c:229] DISTRIB_CODENAME=artful
I: 10/25/17 08:23:36 - [main.c:229] DISTRIB_DESCRIPTION="Ubuntu 17.10"
I: 10/25/17 08:23:36 - [main.c:222] Contents of /etc/os-release:
I: 10/25/17 08:23:36 - [main.c:229] NAME="Ubuntu"
I: 10/25/17 08:23:36 - [main.c:229] VERSION="17.10 (Artful Aardvark)"
I: 10/25/17 08:23:36 - [main.c:229] ID=ubuntu
@pcewing
pcewing / pmk_keys.txt
Created November 10, 2017 02:11
DCS 1u Blank Keycaps available in all rows on PMK
Color: BLUE, Code: BFC
Color: WHITE, Code: WFJ
Color: BLACK, Code: NEM
Color: WHITE, Code: WA
Color: BLACK, Code: NN
Color: WHITE, Code: WFK
Color: WHITE, Code: WBK
Color: GRAY, Code: GEC
Color: GRAY, Code: GAL
Color: GRAY, Code: GRA
@pcewing
pcewing / temp.sh
Created December 12, 2017 03:04
Install utilities for Ubuntu
#!/usr/bin/env bash
apt_install ()
{
sudo apt-get -y install $1
}
apt_is_installed ()
{