This file contains 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
"editor.tokenColorCustomizations": { | |
"textMateRules": [ | |
{ | |
"name": "atoms and such", | |
"scope": "constant.other.symbol.elixir", | |
"settings": { | |
"foreground": "#489CC8" | |
} | |
}, | |
{ |
This file contains 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
-module(connection). | |
-behaviour(gen_statem). | |
-export([start_link/1, request/2]). | |
-export([callback_mode/0, init/1]). | |
-export([disconnected/3, connected/3]). | |
%% Public API. | |
start_link(Opts) -> |
This file contains 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
/* | |
FastLED Fire 2018 by Stefan Petrick | |
The visual effect highly depends on the framerate. | |
In the Youtube video it runs at arround 70 fps. | |
https://www.youtube.com/watch?v=SWMu-a9pbyk | |
The heatmap movement is independend from the framerate. | |
The actual scaling operation is not. |
This file contains 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
# See https://github.com/elixir-lang/elixir/blob/master/lib/elixir/src/elixir_parser.yrl#L52 | |
# for the list of operators with associativity, etc. | |
# The operators in this list are grouped by precedence, low to high. | |
# The comments indicate the operator's normal function, as well as its ability to be defined/overridden. | |
-> # CompileError 'unhandled operator'. only allowed in anonymous function syntax. | |
& # CompileError, only allowed in short anonymous function syntax. |
This file contains 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
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains 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
#!/bin/bash | |
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
set -e | |
sourceApp="$1" | |
targetApp="$2" | |
while read key value; do |
This file contains 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
defmodule Fun do | |
def arity(fun) do | |
case :erlang.fun_info(fun, :arity) do | |
{ :arity, arity } -> | |
arity | |
end | |
end | |
def adapt!(fun, 0) do | |
fn -> fun.([]) end |
This file contains 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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
NewerOlder