This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#test for editing | |
#setup on the command line | |
gem install rspec | |
rspec --init | |
#add to gemfile: | |
group :test, :development do | |
gem 'rspec-rails' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar expede-packages | |
'( | |
cucumber-goto-step | |
ac-haskell-process | |
ac-html | |
ac-helm | |
ac-octave | |
brainfuck-mode | |
coffee-mode | |
helm-robe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query IntrospectionQuery { | |
__schema { | |
queryType { name } | |
mutationType { name } | |
types { | |
...FullType | |
} | |
directives { | |
name | |
description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{: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}}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hypothetical rewrite of `File.read` | |
# Not the lack of a `OtherFile.read!` (with a bang), | |
# but we get the same effect with the caller via `>>>` | |
# Success | |
iex> OtherFile.read("./existing_file.txt") | |
"I'm a little teapot short and stout ..." | |
# Error | |
# Note that this returns an Exception struct as a value |
OlderNewer