Map [1]
Operation | Time Complexity |
---|---|
Access | O(log n) |
Search | O(log n) |
Insertion | O(n) for <= 32 elements, O(log n) for > 32 elements [2] |
Deletion | O(n) for <= 32 elements, O(log n) for > 32 elements |
def wait_until(timeout \\ 1_000, fun) | |
def wait_until(0, fun), do: fun.() | |
def wait_until(timeout, fun) do | |
fun.() | |
rescue | |
ExUnit.AssertionError -> | |
:timer.sleep(10) |
This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.
# How to run Ecto migrations from IEx console... Examples | |
# preliminaries assumed in the following code, change to fit your environment: | |
alias YourAppName.Repo | |
your_app_name_as_atom = :mpnetwork | |
downto_version = 20170724182558 | |
# Down: | |
Ecto.Migrator.run(Repo, "priv/repo/migrations/", :down, [to: downto_version]) |
Thanks for watching my talk, Domain-Driven Desire at Øredev 2016. Here's a list of resources that inspired me, and will hopefully inspire you:
#!/bin/bash | |
function test { | |
MESSAGE=$1 | |
RECEIVED=$2 | |
EXPECTED=$3 | |
if [ "$RECEIVED" = "$EXPECTED" ]; then | |
echo -e "\033[32m✔︎ Tested $MESSAGE" | |
else |
# debugging | |
save_and_open_page | |
puts page.body | |
puts find("#id").native | |
puts first("#id .class element").native | |
# navigating | |
visit('/projects') | |
visit(post_comments_path(post)) | |
Once upon a time…
I once took notes (almost sentence by sentence with not much editing) about the architectural design concepts - Command and Query Responsibility Segregation (CQRS) and Event Sourcing (ES) - from a presentation of Greg Young and published it as a gist (with the times when a given sentence was heard).
I then found other summaries of the talk and the gist has since been growing up. See the revisions to know the changes and where they came from (aka the sources).
It seems inevitable to throw Domain Driven Design (DDD) in to the mix.
# As used with CanCan and Devise | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
include ErrorResponseActions | |
rescue_from CanCan::AccessDenied, :with => :authorization_error | |
rescue_from ActiveRecord::RecordNotFound, :with => :resource_not_found | |
before_filter :authenticate! |