Skip to content

Instantly share code, notes, and snippets.

<template>
<div>
<p class="menu-label">Latest Callsigns</p>
<input class="input" type="text" placeholder="Filter stations..." v-model="stationFilter">
<div class="station-list">
<button
v-for="callsign in filteredStations"
:key="callsign"
@click="focusMarker(callsign)"
class="button is-small"
@schrockwell
schrockwell / atom.ex
Last active October 19, 2021 12:21
Ecto atom custom type
defmodule MyApp.Ecto.Atom do
@behaviour Ecto.Type
#
# BEHAVIOUR
#
def type, do: :string
def cast(value) when is_binary(value) or is_atom(value) do
@schrockwell
schrockwell / moon.rb
Created January 18, 2018 03:38
Moon az/el calculations
# Source: https://github.com/gregseth/suncalc-php/blob/master/suncalc.php
require 'date'
RAD = Math::PI / 180.0
DEG = 180.0 / Math::PI
E = RAD * 23.4397 # obliquity of the Earth
J2000 = 2451545
def to_days(datetime)
datetime.ajd.to_f - J2000
@schrockwell
schrockwell / drawers.rb
Last active July 20, 2017 10:52
Ruby script for restructuring Phoenix 1.3 apps
#
# SET OPTIONS HERE
#
# True means that no files will actually be moved
@dry_run = false
# False keeps the same controller and view file names, whereas
# true renames them to controller.ex and view.ex, respectively.
@shorten_names = false
@schrockwell
schrockwell / tips.md
Created July 12, 2017 18:04
How To Build a Scalable Phoenix Application

Don't reference Repo in a controller

Don't do this:

def show(conn, %{"id" => id}) do
  post = Repo.get(Post, id)
  render(conn, "show.html", post: post)
end
@schrockwell
schrockwell / rhr-sites-ugc.csv
Last active July 25, 2016 22:13
RHR stations UGC CSV
Site UGC
W1/Calais MEC029
W1/Eastport MEC029
W2/Summit NYC095
W2/Blueberry NYC027
W4/Atlanta GAC171
W7/Tacoma WAC033
W7/Portland WAC071
W2/Quaker NYC027
W2/Windham NYC039

Keybase proof

I hereby claim:

  • I am schrockwell on github.
  • I am schrockwell (https://keybase.io/schrockwell) on keybase.
  • I have a public key whose fingerprint is 7B69 522C FD44 A985 3538 8978 F914 E3FB CA95 E3AC

To claim this, I am signing this object:

@schrockwell
schrockwell / freedv.sh
Created December 7, 2012 16:59
Compiling Codec 2 and FreeDV on Windows
# Compiling Codec 2 and FreeDV on Windows
# Rockwell Schrock, WW1X
# December 7, 2012
#
# Based off the README.Win32 file in the FreeDV SVN repository.
# Tested on Windows 7 32-bit.
#
# More info: http://freedv.org/
#
# Install MinGW with options: C Compiler, C++ Compiler, MSYS
@schrockwell
schrockwell / linode_dns.rb
Created August 21, 2012 12:52
Linode dynamic DNS updater v0.0.3
#! /usr/bin/env ruby
#
# Linode dynamic DNS updater
# Version 0.0.3
# August 21, 2012
#
# By Rockwell Schrock
# schrockwell@gmail.com
# https://gist.github.com/3415112
@schrockwell
schrockwell / yahtzee.rb
Created August 15, 2012 13:07
Yahtzee CLI v0.0.2
#!/usr/bin/env ruby
# encoding: utf-8
# Yahtzee CLI
# Version 0.0.2
#
# By Rockwell Schrock
# schrockwell@gmail.com
# https://gist.github.com/gists/3359964
#