Skip to content

Instantly share code, notes, and snippets.

Avatar

Zac West zacwest

View GitHub Profile
@zacwest
zacwest / associate.sh
Last active Dec 5, 2022
Associate Sublime Text with various programming file extensions
View associate.sh
#!/bin/bash
if ! command -v duti &> /dev/null; then
brew install duti
fi
declare -a extensions=(
## uti-based
public.plain-text
public.source-code
@zacwest
zacwest / baseball_standings.js
Last active Jun 13, 2022
Post Baseball standings to Slack. This code is awful, I don't know JavaScript, but it works. You probably need to figure out the emoticons for each team in your Slack.
View baseball_standings.js
var token = 'your-token-here'; // from https://erikberg.com/api for wildcard
var agent = 'Your/1.0 <user@agent>';
var fetch = require('node-fetch');
var hooks = {'https://hooks.slack.com/services/…': '#channel',
'https://hooks.slack.com/services/…': '#channel'};
var team_table = {
"los-angeles-dodgers": ":dodgerslogo:",
"san-francisco-giants": ":giants:",
@zacwest
zacwest / ios-font-sizes.swift
Last active Jan 24, 2023
iOS default font sizes - also available on https://www.iosfontsizes.com
View ios-font-sizes.swift
let styles: [UIFont.TextStyle] = [
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
for style in styles {
@zacwest
zacwest / ZSWFileTester.m
Created Jun 3, 2015
Saving optimal JPEGs
View ZSWFileTester.m
//
// ZSWFileTester.m
// Image Size Test
//
// Created by Zachary West on 3/4/14.
// Copyright (c) 2014 Zachary West. All rights reserved.
//
#import "ZSWFileTester.h"