Skip to content

Instantly share code, notes, and snippets.

type QueryLoading = {
status: 'LOADING'
}
type QueryError = {
status: 'ERROR'
error: Error
}
type QuerySuccess<SuccessType> = {
@macrael
macrael / gh-action-notify.sh
Last active December 16, 2021 23:37
This script watches the currently running github action for the current branch and `say`s "Github action run complete" when it finishes.
#!/bin/bash
# Get Branch Name
branch_name=$(git rev-parse --abbrev-ref HEAD)
# Filter Running Actions
run_line=$(gh run list | grep "$branch_name" | grep "in_progress" | head -n 1)
if [ -z "$run_line" ]; then
echo "No active GH action run found for the current branch"
import Foundation
private let tapInterval = 0.2
enum DoubleTap {
case nope
case firstDown(Date)
case firstUp(Date)
case secondDown(Date)
case doubleTapped
package postgres
import (
"fmt"
"testing"
"time"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq" // required for sqlx + postgres
)
@macrael
macrael / interface_star.go
Last active August 31, 2017 02:12
Exploring how interfaces interact with methods that have pointer receivers.
// Run this with go run.
package main
import "fmt"
type Counter interface {
bumpAndCount() int
sayMyName() string
}

I went through all the questions asked by Public Policy Polling released on 2017-02-05 here: http://www.publicpolicypolling.com/pdf/2017/PPP_Release_National_21017.pdf and categorized them based on wether or not people who voted for Trump in the last election mostly agreed with one another or if there was some disagreement. If no numbers are next to a question name, then the split was strong, like 90/10 on one side and 10/90 on the other. If I included one set of numbers then that was the DJT voter's breakdown, and if both are there it's Trump voters first and Clinton second.

Answers Overwhelmingly Split On Who You Voted For

  • Trump Approval (91/6/3 vs 2/95/2)
  • Trump Favorability
  • Support for EO Banning Refugees
  • EO Intended to Ban Muslims (19/73/8 vs 73/19/8)
  • Trust Judges more than Trump (14/78 vs 91/5)
  • Conway Favorability (73/6/21 vs 3/86/12)
class FooClass {
var name: String = "" {
didSet(newName) {
print("SET")
print(newName)
}
}
func changeAName(inout theProp: String) {