Skip to content

Instantly share code, notes, and snippets.

@tatey
tatey / factorial
Created July 21, 2009 12:13
Factorial in assembly (M6800)
; Course: 1007ICT - Griffith University
; Assignment: 2
; Author: Tate Johnson
; Created: 2008-05-30
; Processor: Motorola 6800
; QUESTION 6
; Calculate factorial of a
; number ranging from 1 - 8,
; depending on desired value
@tatey
tatey / shell.nix
Created February 23, 2023 23:21
Minimal shell.nix for Ruby on Rails
let
nixpkgs =
import (builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/f5dad40450d272a1ea2413f4a67ac08760649e89.tar.gz; # Pinned to unstable. Update by picking a SHA from https://status.nixos.org
}) { };
in
nixpkgs.mkShell {
buildInputs = [
nixpkgs.ruby_3_1
nixpkgs.nodejs-18_x
@tatey
tatey / 1_sources.nix
Created February 23, 2023 23:17
0_shell.nix
# This file has been generated by Niv.
let
#
# The fetchers. fetch_<type> fetches specs of type <type>.
#
fetch_file = pkgs: spec:
if spec.builtin or true then
@tatey
tatey / Makefile
Created October 18, 2014 12:17
Simple alternative to gulp
BIN = ./node_modules/.bin
all: css js html
css:
mkdir -p build/
$(BIN)/node-sass css/index.css.sass -o build/index.css
js:
mkdir -p build/
@tatey
tatey / 0_shell.nix
Last active November 1, 2022 07:33
A quick script to enable "all access" on a bunch of projects
let
nixpkgs =
import (builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/e6e6bad81b7e11f37d893ef39712ce8918ae2338.tar.gz;
}) { };
in
nixpkgs.mkShell {
buildInputs = [
nixpkgs.chromedriver
nixpkgs.ruby_3_1
#!/usr/bin/env bash
# Datadog bills by the number of unique hosts that were used in the month and
# every time we launch a one off dyno it results in a new
# host (e.g. run.4030404). This script is executed when the dyno launches and
# determines whether the agent should be running to reduce the number of
# unique hosts that we are billed for.
# Disable the Datadog Agent for one-off runs (e.g. console, release).
if [ "$DYNOTYPE" == "run" ] || [ "$DYNOTYPE" == "release" ]; then
@tatey
tatey / 00_cli
Created May 17, 2019 11:28
Federal Election 2019 Bingo Card Generator in Ruby
$ ruby 01_bingo.rb > ~/Downloads/board_1.html
@tatey
tatey / 0_MyView.swift
Created March 30, 2019 11:56
Why can't I use this "setter" via the Appearance proxy?
class MyView: UIView {
func set(borderTintColor: UIColor?, forControlState controlState: UIControl.State) {
// literally empty
}
// I've also tried prefixing with @objc
}
@tatey
tatey / 0_MyView.swift
Created March 30, 2019 11:56
Why can't I use this "setter" via the Appearance proxy?
class MyView: UIView {
func set(borderTintColor: UIColor?, forControlState controlState: UIControl.State) {
// literally empty
}
// I've also tried prefixing with @objc
}
import UIKit
class LayoutMarginsHackView: UIView {
var actualLayoutMargins: UIEdgeInsets = .zero
override var layoutMargins: UIEdgeInsets {
set {
if #available(iOS 11, *) {
super.layoutMargins = newValue
} else {