Skip to content

Instantly share code, notes, and snippets.

View woodnathan's full-sized avatar

Nathan Wood woodnathan

View GitHub Profile
@woodnathan
woodnathan / opml.xslt
Created June 15, 2022 23:29
OPML to HTML XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" />
<xsl:template match="opml">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html>]]></xsl:text>
<html>
<head>
<meta charset="utf-8" />
<xsl:apply-templates select="head/title" />
@woodnathan
woodnathan / audit.js
Created November 22, 2018 06:47
Font Audit Utility
console.log( 'FontAudit', Array.from( document.querySelectorAll( '*' ) ).flatMap( function ( el ) {
return [ [ el, getComputedStyle( el ) ], [ el, getComputedStyle( el, ':before' ) ], [ el, getComputedStyle( el, ':after' ) ] ];
} ).reduce( function ( fs, cst ) {
var el = cst[ 0 ];
var cs = cst[ 1 ];
var ff = cs[ 'font-family' ];
var fw = cs[ 'font-weight' ];
fs[ ff ] = fs[ ff ] || {};
fs[ ff ][ fw ] = fs[ ff ][ fw ] || new Set();
fs[ ff ][ fw ].add( el );
@woodnathan
woodnathan / pre-commit.sh
Last active June 30, 2016 07:14
xUnique pre-commit script
#!/bin/bash
echo "pre-commit xunique script start"
while read line
do
if [[ $line =~ .*project.pbxproj$ ]]
then
pbxprojPath="$line"
[ -e "$pbxprojPath" ] && xunique -c "$pbxprojPath"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <netinet/in.h>
// Network Packet Struct
typedef struct {
int fd;
struct sockaddr_in cli_addr;
@woodnathan
woodnathan / remove_fetch_snippet.sh
Created November 5, 2014 03:23
Disable Xcode 6's Fetch Request code snippet completion
#!/bin/bash
sudo sed -i.bak 's/<string>fetch<\/string>/<string><\/string>/g' /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/SystemCodeSnippets.codesnippets
@woodnathan
woodnathan / Instructions
Last active August 29, 2015 14:04
Xcode Gitignore
Create ~/.gitignore_global
@woodnathan
woodnathan / org.nginx.old.plist
Last active August 29, 2015 14:04
Nginx Launchd Plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>nginx</string>
<key>Program</key><string>/usr/local/sbin/nginx</string>
<key>KeepAlive</key><true/>
<key>NetworkState</key><true/>
<key>StandardErrorPath</key><string>/var/log/system.log</string>

Keybase proof

I hereby claim:

  • I am woodnathan on github.
  • I am woodnathan (https://keybase.io/woodnathan) on keybase.
  • I have a public key whose fingerprint is D97D 2CDF 01F1 E1BC AEA5 E22F 1966 DB12 C352 029A

To claim this, I am signing this object:

static inline CGFloat map(CGFloat input, CGFloat inMinimum, CGFloat inMaximum, CGFloat outMinimum, CGFloat outMaximum)
{
CGFloat returnValue;
CGFloat deltaIn = inMaximum - inMinimum;
CGFloat deltaOut = outMaximum - outMinimum;
returnValue = (input - inMinimum) / deltaIn;
returnValue = returnValue * deltaOut;
returnValue = returnValue + outMinimum;
//
// BSAuthor.h
// BookstoreApp
//
// Created by Nathan Wood on 17/06/2014.
// Copyright (c) 2014 Nathan Wood. All rights reserved.
//
#import <Foundation/Foundation.h>