Skip to content

Instantly share code, notes, and snippets.

View tmecklem's full-sized avatar

Tim Mecklem tmecklem

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tmecklem on github.
  • I am timmecklem (https://keybase.io/timmecklem) on keybase.
  • I have a public key whose fingerprint is 6CC5 AE72 EAF9 F040 D1DF D1B9 9E27 F650 E0BB 4FAA

To claim this, I am signing this object:

defmodule ElixirGame do
@moduledoc """
Documentation for `ElixirGame`.
"""
@doc ~S"""
return the answer to a very important topic
## Examples

You can mount the SD card on a laptop/desktop and create the /boot/wifi.yml file. /boot/wifi.yml looks something like:

networks:
 - ssid: Home
   psk: wheretheheartis
   priority: 100
 - ssid: Work
   psk: gettinstuffdone
   priority: 99
@tmecklem
tmecklem / ecto_merge_til.md
Last active June 28, 2018 11:53
TIL Ecto select_merge

Using Ecto's virtual fields with select_merge

You may know that Ecto has a "virtual" field type that you can use to include pretty much anything in an Ecto struct. But did you know that you can also populate a virtual field directly in an Ecto Query?

Say I have a users table, and joined to that I have a posts table. The User has_many Posts. The User schema looks like this:

  schema "users" do
    field :name, :string
    
Application.put_env(:subg_rfspy, :serial_driver, SubgRfspy.UART)
SubgRfspy.UART.start_link("/dev/ttyAMA0")
SubgRfspy.set_base_frequency(916.500)
alias RFM69.{Configuration, Device}
Device.start_link("spidev0.0", 24, 23)
test_configuration = %Configuration{
op_mode: 0x00,
frf: Configuration.frequency_to_registers(916_600_000),
bitrate: Configuration.bitrate_to_registers(16_384),
data_modul: 0x08,
pa_level: 0x5F,
/*
Determine Basal
Released under MIT license. See the accompanying LICENSE.txt file for
full terms and conditions
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Feature: Building longest road
Scenario: Build 5 connected roads
Given a 3 player game at the start of round 3
And the board has the following items:
| type | location | player |
| settlement | A,t | 1 |
| road | A,nw | 1 |
| road | A,w | 1 |
| road | A,sw | 1 |

Keybase proof

I hereby claim:

  • I am tmecklem on github.
  • I am timmecklem (https://keybase.io/timmecklem) on keybase.
  • I have a public key whose fingerprint is BF45 7217 BA9E 2F1A ACD6 557E 0589 7F96 58EA 4DE1

To claim this, I am signing this object: