Skip to content

Instantly share code, notes, and snippets.

View rawkode's full-sized avatar
Ready to Help, Coffee Appreciated.

David Flanagan rawkode

Ready to Help, Coffee Appreciated.
View GitHub Profile
@rawkode
rawkode / cleanup.sh
Created May 10, 2016 14:16
Cleanup Docker Containers
#!/usr/bin/env bash#
##
# Clean up old preview environments each night at 10pm
##
docker rm -f $(docker ps -aq)
docker network rm $(docker network ls -q)
docker volume rm $(docker volume ls -q)
@rawkode
rawkode / mission-statement
Last active August 10, 2016 17:12
ScotlandPHP
Mission Statment
Scotland PHP is aiming to be the first “inclusive first” conference. There are no special events. nor speaker dinner. This conference is for the 90% - not the 10%. We promise to make everyone feel welcome; everyone will be involved, and everyone is encouraged to join the conversation.
Our CfP is for anyone; tell us what you’re passionate about and we’ll listen. Our CfP will also be driven by our community; so tell us what you want to hear.
Beyond the preparation, we aim to give everyone a very personal and awesome experience; so get involved and let us know what you want.
We hope to provide the most unique and engaging conference experience you’ve received to-date; if we can do any better - just let us know.
@rawkode
rawkode / SomeModel.ex
Last active October 20, 2016 12:18
Event Sourcing: Pattern Matching Event Handlers in Elixir
defmodule Domain.User do
def email_updated(%Event{ type: "UserUpdatedEmail", version: 1 } = event)
# do something with event
end
def email_updated(%Event{ type: "UserUpdatedEmail", version: 2 } = event)
# do something with event
end
end
@rawkode
rawkode / keybase.md
Last active January 21, 2017 10:35
keybase.md

Keybase proof

I hereby claim:

  • I am rawkode on github.
  • I am rawkode (https://keybase.io/rawkode) on keybase.
  • I have a public key ASCGIt8NXg48Ltrl9XeI10IOJXOAaw_5ztLBfbepPYw0vwo

To claim this, I am signing this object:

@rawkode
rawkode / openpgp.txt
Created January 22, 2017 13:52
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:80883f4dd6c4885631af70f4ff11ce4277725496]
@rawkode
rawkode / README.md
Last active March 11, 2017 08:57
WebPack Output

I have a standard ReactJS project. Using webpack, my build outputs a dist/ like the following:

- js/
- css/
- assets/
  - images/
  - fonts/
 - index.html
@rawkode
rawkode / main.php
Created April 10, 2017 19:49
PHP Retry
<?php
try {
// code ...
} catch(SomeException $eex) {
// Fatal exception, no retry
$logger->debug("blah");
break;
} catch(AnotherException $aex) {
// log exception and retry
@rawkode
rawkode / Dockerfile
Created June 7, 2017 11:42
Docker Multistage Builds
# Node Tasks
FROM node:latest as node
COPY . /code
WORKDIR /code
RUN npm install
# PHP Tasks
@rawkode
rawkode / login.ex
Last active September 6, 2017 01:53
Elixir is Awesome
defmodule UserService.Http.Endpoints.Login do
@moduledoc """
<Purged for Gist>
"""
use Plug.Builder
use Eidetic.CommandBus, command: UserService.User.Commands.Login
alias UserService.User
def index(connection) do
@rawkode
rawkode / Dockerfile
Created September 13, 2017 09:22
Docker Mutistage Build Example
FROM gcc AS builder
COPY main.c /code/main.c
WORKDIR /code
RUN gcc -static main.c -o main
FROM scratch
COPY --from=builder /code/main /main