let Uploaders = {} | |
Uploaders.S3 = function (entries, onViewError) { | |
entries.forEach(entry => { | |
let xhr = new XMLHttpRequest() | |
onViewError(() => xhr.abort()) | |
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error()) | |
xhr.onerror = () => entry.error() | |
xhr.upload.addEventListener("progress", event => { | |
if (event.lengthComputable) { |
I was drawn to programming, science, technology and science fiction | |
ever since I was a little kid. I can't say it's because I wanted to | |
make the world a better place. Not really. I was simply drawn to it | |
because I was drawn to it. Writing programs was fun. Figuring out how | |
nature works was fascinating. Science fiction felt like a grand | |
adventure. | |
Then I started a software company and poured every ounce of energy | |
into it. It failed. That hurt, but that part is ok. I made a lot of | |
mistakes and learned from them. This experience made me much, much |
npm install --save express express-openid-connect |
-
Uses native vim regexes (which are slightly different from the regexes used by grep, ack, ag, etc) so the patterns are the same as with vim's within-file search patterns.
You can do a normal within-file search first, then re-use the same pattern to
I started with Elixir just a couple weeks after the switch from 1.4 to 1.5, so the bulk of online resources were out of date (or at least resulted in deprecation warnings). This guide is for defining Elixir 1.5 supervised modules.
It's not actually terribly complicated. It's just sometimes unclear from examples what's implemented by the language and what you actually have to implement yourself.
Say we want a supervision tree like this (where each atom is a process):
:a
/ \
defmodule Box do | |
defmacro __using__(_env) do | |
quote do | |
import Box | |
end | |
end | |
@doc """ | |
Define module with struct and typespec, in single line |
#! /bin/zsh | |
tmux \ | |
new-session -d -s $sessionName -n emacs 'emacs .' \;\ | |
new-window -n 'app' "bin/run" \;\ | |
new-window -n 'build' "bin/build" \;\ | |
new-window -n 'tests' "bin/test" \;\ | |
new-window -n git \;\ | |
selectw -t emacs |
TIL how to make deprecation warnings:
Compiling 2 files (.ex)
warning: `Retort.Resources.timeout/2` is deprecated; call `Retort.Resources.Timeout.get_or_default/2` instead.
lib/retort/resources.ex:197: Retort.Resources.timeout/2
Replace function