Skip to content

Instantly share code, notes, and snippets.

View jeffkreeftmeijer's full-sized avatar
🦞

Jeff Kreeftmeijer jeffkreeftmeijer

🦞
View GitHub Profile

cargo install --locked

While installing cargo-generate I ran into an error compiling caused by missing type annotations in cargo itself.

link:e0283.txt[role=include]

An already-closed issue in Cargo explained that the issue originated in the serde crate, and was already resolved. While waiting for a patched release, users were advised to use cargo install --locked.

@jeffkreeftmeijer
jeffkreeftmeijer / generate
Last active January 26, 2021 15:01
.mov to .gif
ffmpeg -i nightfall.mov -filter_complex "fps=10,scale=960:-1" nightfall.gif

Embrace email, mute Slack. A policy for handling incoming messages

Property-based testing in Elixir using PropEr

<ul>
<li>
<article>
<time datetime="2017-10-17">2017-10-17</time>
<span><a href="/vim-reformat-dates/">Find, convert and replace dates with Vim substitutions</a></span>
</article>
</li>
<li>
<article>
<time datetime="2017-09-19">2017-09-19</time>
fn count_down() {
"3... 2... 1..."
}
fn blast_off() {
"BOOM!"
}
pub fn launch() {
[
@jeffkreeftmeijer
jeffkreeftmeijer / README.md
Last active December 29, 2020 14:45
Visualising recursive function calls in Elixir

Visualising recursive function calls in Elixir

For SICP Exercise 1.14 in Elixir, we'll first implement the count_change/1 function, which calculates how many different ways there are to make change using half-dollars (50 ¢), quarters (5 ¢), dimes (5 ¢) and pennies (1 ¢) for any given amount of money.

iex -r counting_change.exs
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
@jeffkreeftmeijer
jeffkreeftmeijer / .ctags
Last active December 24, 2020 14:34
~/.ctags
--exclude=node_modules
--langdef=Elixir
--langmap=Elixir:.ex.exs
--regex-Elixir=/^[ \t]*def(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/f,functions,functions (def ...)/
--regex-Elixir=/^[ \t]*defcallback[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/c,callbacks,callbacks (defcallback ...)/
--regex-Elixir=/^[ \t]*defdelegate[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/d,delegates,delegates (defdelegate ...)/
--regex-Elixir=/^[ \t]*defexception[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/e,exceptions,exceptions (defexception ...)/
--regex-Elixir=/^[ \t]*defimpl[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/i,implementations,implementations (defimpl ...)/
--regex-Elixir=/^[ \t]*defmacro(p?)[ \t]+([a-z_][a-zA-Z0-9_?!]*)\(/\2/a,macros,macros (defmacro ...)/
class Foo
def foo
puts "ok!"
end
end
Foo.prepend(Module.new do
def foo
puts "prepend!"
super