Skip to content

Instantly share code, notes, and snippets.

View armcknight's full-sized avatar
🏔️

Andrew McKnight armcknight

🏔️
View GitHub Profile
@armcknight
armcknight / xcode_to_github.sh
Created March 12, 2025 01:08 — forked from mr-fixit/xcode_to_github.sh
generates the github URL of the topmost file in xcode
#!/bin/zsh
# this script outputs the github URL of the frontmost file in Xcode.
# v0.2
which jq || echo install jq with \'brew install jq\'; exit 1
TUPLE=$(osascript << HERE
tell application "Xcode"
set doc to document 1 whose name ends with (word -1 of (get name of window 1))
set currentLines to selected paragraph range of doc
Your post advocates a
( ) technical ( ) legislative ( ) market-based ( ) vigilante
approach to fighting spam. Your idea will not work. Here is why it won't work. (One or more of the following may apply to your particular idea, and it may have other flaws which used to vary from state to state before a bad federal law was passed.)
( ) Spammers can easily use it to harvest email addresses
( ) Mailing lists and other legitimate email uses would be affected
( ) No one will be able to find the guy or collect the money
( ) It is defenseless against brute force attacks
@armcknight
armcknight / twitter-og-logo.svg
Last active July 24, 2023 19:14
Twitter OG Logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armcknight
armcknight / twitter-larry-bird-behind-the-scenes.svg
Created July 24, 2023 19:09
Twitter Larry Bird Behind the Scenes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armcknight
armcknight / twitter-larry.svg
Created July 24, 2023 19:06
Twitter Larry Bird SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armcknight
armcknight / one-liners.sh
Last active April 25, 2023 20:12
Collection of useful terminal commands
# from @danielpunkass: Here’s my shorthand trick for dumping a binary
# to see the context of where the ObjC methods are implemented, even
# if they don’t export debugger symbols:
otool -ov <binaryname> | grep -A 3 <methodName>
@armcknight
armcknight / sy.md
Created January 31, 2022 20:40 — forked from cornchz/sy.md
Notes from the Mystery Machine Bus - Steve Yegge

Notes from the Mystery Machine Bus

I've spent the past eight years (starting back in June 2004) writing elaborate rants about a bunch of vaguely related software engineering issues.

I was doing all that ranting because I've been genuinely perplexed by a set of "bizarre" world-views held dear by -- as far as I can tell -- about half of all programmers I encounter, whether online or in person.

Last week, after nearly a decade of hurling myself against this problem, I've finally figured it out. I know exactly what's been bothering me.

In today's essay I'm going to present you with a new conceptual framework for thinking about software engineering. This set of ideas I present will be completely obvious to you. You will probably slap yourself for not having thought of it yourself. Or you might slap the person next to you. In fact you probably have thought of it yourself, because it is so blindingly obvious.

@armcknight
armcknight / gurl.fish
Created January 29, 2022 00:59
construct a GitHub URL with a filename and optionally line number/range in the current repo/branch
function gurl -a filePath lineNumber rangeEndLineNumber -d "create a URL for a file on GitHub's website, for the current repo and working branch, optionally with a line number or range"
set branchname (git rev-parse --abbrev-ref HEAD)
set repourl (git config --get remote.origin.url | sed s/\\.git// | sed 's/:/\//' | sed 's/.*github.com/https:\/\/github.com/') # h/t https://gist.github.com/richardmcmillen-examtime/7448300
if test (count $argv) -eq 3
echo $repourl/blob/$branchname/$filePath\#L$lineNumber-L$rangeEndLineNumber
else if test (count $argv) -eq 2
echo "$repourl/blob/$branchname/$filepath#L$lineNumber"
else
echo $repourl/blob/$branchname/$filePath
end
@armcknight
armcknight / gweb.fish
Created January 29, 2022 00:33
Fish shell function to open a file in current local git repo on GitHub's website
function gweb -d "view a file on GitHub's website, in the current repo and working branch"
set branchname (git rev-parse --abbrev-ref HEAD)
set repourl (git config --get remote.origin.url | sed s/\\.git// | sed 's/:/\//' | sed 's/.*github.com/https:\/\/github.com/') # h/t https://gist.github.com/richardmcmillen-examtime/7448300
open $repourl/blob/$branchname/$argv[1]
end
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN