Skip to content

Instantly share code, notes, and snippets.

View apexskier's full-sized avatar

Cameron Little apexskier

View GitHub Profile
$fn=60;
outerD = 90;
innerD = 57.5;
base = 3;
h = 35+base;
segments = 3;
de = 3;
@apexskier
apexskier / starlink-yakima-mount.scad
Created December 30, 2023 01:14
Starlink yakima mount
@apexskier
apexskier / useDocumentTitle.ts
Last active June 29, 2021 14:19
useDocumentTitle template literal hook
import React from "react";
export function useDocumentTitle(
strings: TemplateStringsArray,
...args: ReadonlyArray<string>
): void {
React.useEffect(() => {
let title = "";
strings.forEach((part, i) => {
title += part;
@apexskier
apexskier / README.md
Last active January 17, 2023 23:56
jira-graphs

A set of utilities I use to generate visual graphs of JIRA progress. Since our Jira is behind SSO, I can't easily query the API directly, so I run this in chrome, after authenticating. It generates a graph in graphviz dot format, which I can then run through http://www.webgraphviz.com/ or using the CLI tool.

These are pretty specific to different projects and workflows, so modify them as you see fit.

@apexskier
apexskier / last-commit.js
Created May 20, 2020 09:37
Github show at last commit
(() => {
const targetParts = document.querySelector('main .repository-content .Box .Box-body > span:last-child a').href.split("/");
const commit = targetParts[targetParts.length - 1];
const urlParts = location.href.split("/");
urlParts[6] = commit;
document.location = urlParts.join("/");
})()
@apexskier
apexskier / standupShuffle.js
Last active April 20, 2022 18:15
Shuffle people quick filters in our Jira board
(() => {
// https://stackoverflow.com/a/2450976/2178159
// Fisher-Yates
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
@apexskier
apexskier / PhoneNumberCleaning.scpt
Last active September 23, 2019 18:53
Script to clean and add international +1 prefix to my contacts
# This script is used when I moved to poland and my phone started not recongizing saved contacts because the incoming number has +1 but the saved number doesn't
# it finds all numbers that aren't prefixed with a "+" country code and look like standard us phone numbers (10 digits, or 11 digits starting with 1) and reformats them to `+1 (DDD) DDD-DDDD`
#
# note: After this syncs to your phone, you'll probably need to restart in order for messages to show the contact name properly
set modified_count to 0
tell application "Contacts"
set all_people to every person
repeat with each_person in all_people
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@apexskier
apexskier / README.md
Last active March 9, 2018 19:21
github view at last commit

This is a simple bookmarklet that redirects the current file you're viewing on github to it's last commit. This is nice for generating permanent links, rather than linking to master which may change.

javascript:"use strict";var _slicedToArray=function(){return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,r){var e=[],n=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(n=(i=c.next()).done)&&(e.push(i.value),!r||e.length!==r);n=!0);}catch(t){o=!0,a=t}finally{try{!n&&c.return&&c.return()}finally{if(o)throw a}}return e}(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();!function(){var t=document.querySelector(".commit-tease-sha").textContent.trim(),r=document.location.pathname.match(/^(\/[\w-_]+\/[\w-_]+\/blob\/)(\w+)(\/.*)/),e=_slicedToArray(r,4),n=(e[0],e[1]),o=(e[2],e[3]);document.location.pathname=""+n+t+o}();
@apexskier
apexskier / update.sh
Last active August 4, 2021 13:08
Update all git repos in a directory
#!/bin/bash
# Updates all git repositories in a directory, doing some housekeeping along the
# way
nocol="\033[m"
green="\033[0;32m"
yellow="\033[1;33m"
lightgrey="\033[0;37m"
darkgrey="\033[1;30m"