Skip to content

Instantly share code, notes, and snippets.

View scottswezey's full-sized avatar
👋
Looking for work

Scott Swezey scottswezey

👋
Looking for work
View GitHub Profile
@scottswezey
scottswezey / aoc_day2.ex
Last active December 3, 2021 00:37
Advent of Code 2021 - Day 2
defmodule Day2 do
@input File.read!("day2-input.txt")
defmodule PosTracker do
@callback new() :: Map.t
@callback new(integer(), integer()) :: Map.t
@callback new(integer(), integer(), integer()) :: Map.t
@callback forward(Map.t, integer()) :: Map.t
@callback up(Map.t, integer()) :: Map.t
@callback down(Map.t, integer()) :: Map.t
@scottswezey
scottswezey / ViewController.swift
Created March 3, 2020 05:02
Attempting to have more control over placement of title and buttons in a UINavigationItem
class ViewController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
// This seems like a really bad idea...
self.children.first?.navigationItem.titleView = navItemReplacementVIew()
}
func navItemReplacementVIew() -> UIView {
@scottswezey
scottswezey / ContentView.swift
Last active August 13, 2020 10:24
My solution for #100DaysOfSwiftUI day 19
import SwiftUI
enum UnitTypes: CaseIterable, Hashable, Identifiable {
case temperature
case length
case time
case volume
var name: String { "\(self)".capitalized }
var id: UnitTypes { self }
test "converts Sid param key to sid" do
conn = build_conn(:get, "/hello?Sid=123", "Test=abc")
%{conn | query_params: Plug.Conn.fetch_query_params(conn)}
conn = FinessTwilioParamsPlug.call(conn, @opts)
assert conn.params == %{"sid" => "123", "test" => "abc"}
end
@scottswezey
scottswezey / keybase.md
Created April 11, 2015 03:07
keybase.md

Keybase proof

I hereby claim:

  • I am scottswezey on github.
  • I am scottswezey (https://keybase.io/scottswezey) on keybase.
  • I have a public key whose fingerprint is 5FB3 557B 064E EC1D 42CE 03A1 5852 80E6 05BA A81E

To claim this, I am signing this object:

Test
line 2, edit 3
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^bowler/profile/stats/(.*)/(.*)$ /info/bowler.php?id=$2 [R]
require 'TodoList'
class App
def self.file_choser
puts "Enter a filename to use:"
gets.chomp
end
def self.main
file = file_choser
class TodoList
attr_accessor :file
def load(file = 'todo.txt')
@file = file
@list = []
# Check that file exists
if using_valid_file?
# read the file, create a list, create items, add them
Name of some item to do
Another items to do
IMPORTANT item
etc