:slack:-up:
Yesterday
- …
- …
Today
- …
- …
$ npm install -g elm-test | |
└─┬ [email protected] | |
├─┬ [email protected] | |
│ ├─┬ [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├── [email protected] | |
│ │ ├─┬ [email protected] | |
│ │ │ └── [email protected] | |
│ │ ├── [email protected] |
// Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
function PV(rate, periods, payment, future, type) { | |
// Initialize type | |
var type = (typeof type === 'undefined') ? 0 : type; | |
// Evaluate rate and periods (TODO: replace with secure expression evaluator) | |
rate = eval(rate); | |
periods = eval(periods); |
# .git/hooks/pre-push | |
#!/usr/bin/env bash | |
set -e | |
trap 'echo interrupted; exit' INT | |
cd $(git rev-parse --show-toplevel) | |
if [ -f "mix.exs" ]; then | |
mix compile --warnings-as-errors |
# p_map is a parallel map which runs each and every process concurrently | |
> p_map = fn -> 1..5 |> Enum.map(fn(i) -> Task.async(fn -> :timer.sleep(200); i + 1 end) end) |> Enum.map(fn(tsk) -> Task.await(tsk) end) end | |
# slow_map runs each and every iteration one after the other | |
> slow_map = fn -> 1..5 |> Enum.map(fn(i) -> :timer.sleep(200); i + 1 end) end | |
> :timer.tc(fn -> p_map.() end, []) | |
{200830, [2, 3, 4, 5, 6]} | |
> :timer.tc(fn -> slow_map.() end, []) |
** (CompileError) lib/spreadsheet/functions.ex:340: definitions with multiple clauses and default values require a header. Instead of: | |
def foo(:first_clause, b \\ :default) do ... end | |
def foo(:second_clause, b) do ... end | |
one should write: | |
def foo(a, b \\ :default) | |
def foo(:first_clause, b) do ... end | |
def foo(:second_clause, b) do ... end |
/** | |
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet. | |
*/ | |
/** | |
* Adds a custom menu with items to show the sidebar and dialog. | |
* | |
* @param {Object} e The event parameter for a simple onOpen trigger. | |
*/ |
// swap the keybindings for paste and paste_and_indent | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" } |
:slack:-up:
Yesterday
Today
[T]he difference between a bad programmer and a | |
good one is whether he considers his code or his | |
data structures more important. Bad programmers | |
worry about the code. Good programmers worry about | |
data structures and their relationships. | |
-- Linus Torvalds | |
~~~ | |
Clarity and brevity sometimes are at odds. | |
When they are, I choose clarity. | |
-- Jacob Kaplan-Moss |
Higher-order Constructs
Use higher-order constructs (libraries, frameworks, tools) instead of building everything from scratch. If there is no higher-order construct yet, build one.
Opaque Data Structures
Use Opaque Data Structures to represent your entities.