Skip to content

Instantly share code, notes, and snippets.

View expede's full-sized avatar
Highly caffeinated

Brooklyn Zelenka expede

Highly caffeinated
View GitHub Profile
use Exceptional
# Success case
iex> OtherFile.read("./existing_file.txt") >>> String.length
1000
# Error case
iex> OtherFile.read("./missing.file") >>> String.length
**(OtherFile.NotFoundError) File not found at ./missing.file
@expede
expede / multiple_error_tuples.ex
Created August 31, 2016 11:57
Elixir Multiple Error Tuples
{:error, "Something went boom"}
{:error, "Something went boom", %{original :data}}
{:error, %{original: :data}}
# Yes, this exists in the wild
{:ok, %{error: %{reason: "something went boom", data: %{original: :data}}}}
@expede
expede / getSchema.graphql
Last active January 26, 2022 19:50
Get complete GraphQL schema
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
@expede
expede / gist:8712eba17daa3980e352
Last active October 26, 2017 22:35
What is the Free Monad + Interpreter pattern?
-- Just the code from http://programmers.stackexchange.com/a/242803
-- ...I find it useful to type this stuff out. Weird, I know.
data DSL next = Get String (String -> next)
| Set String String next
| End
p1 :: DSL (DSL (DSL next))
p1 = Get "foo" $ \foo -> Set "bar" foo End
@expede
expede / gist:31c89c0b755ad80fc568
Created January 15, 2015 22:40
spacemacs configuration packages
(defvar expede-packages
'(
cucumber-goto-step
ac-haskell-process
ac-html
ac-helm
ac-octave
brainfuck-mode
coffee-mode
helm-robe
### Keybase proof
I hereby claim:
* I am expede on github.
* I am expede (https://keybase.io/expede) on keybase.
* I have a public key whose fingerprint is F233 CD9A 63AE 700A 7BD2 451A FB83 8D90 B29C 377A
To claim this, I am signing this object:
@expede
expede / .spacemacs
Last active August 26, 2023 02:56
Spacemacs Config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@expede
expede / debase.zsh
Last active August 29, 2015 14:08
git debase
# Similar to a squashed rebase
# Merges branch A into B, and then resets the branch to A,
# producing an unstaged diff of B for your commit
# exampe usage: `debase master`
# (note the lack of `git` prefix)
function debase() {
if [[ -z $1 ]]; then
echo 'missing branch to debase from'
else
branch=${1}
#test for editing
#setup on the command line
gem install rspec
rspec --init
#add to gemfile:
group :test, :development do
gem 'rspec-rails'
end