This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
# Generally based on ideas found at: | |
# http://www.garth.org/archives/2011,08,27,169,fix-time-machine-sparsebundle-nas-based-backup-errors.html | |
# | |
# Reduced the ideas there down to their essentials. | |
# 1. Unlock the image. | |
# 2. Reset the saved failure in the backup metadata. | |
# 3. Verify/fix the filesystem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LineParser.swift | |
// | |
// Created by Adam Knight on 1/26/18. | |
// | |
import Foundation | |
public class LineParser: Sequence, IteratorProtocol { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIFont (Sanity) | |
+(UIFont*)preferredFontForTextStyle:(NSString *)style withFontFamily:(NSString*)family; | |
@end | |
@implementation UIFont (Sanity) | |
+(UIFont*)preferredFontForTextStyle:(NSString*)style withFontFamily:(NSString*)family | |
{ | |
UIFont *font = nil; | |
UIFontDescriptor *descriptor = nil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOSTNAME=$(hostname -f) | |
GREEN=$( tput setaf 10 ) | |
CYAN=$( tput setaf 14 ) | |
RED=$( tput setaf 1 ) | |
GRAY=$( tput setaf 8 ) | |
RESET=$( tput setaf 7 ) | |
NAME=$( basename "$0" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CMD=() | |
for i in "$@"; do | |
if [[ $i =~ "[[:space:]]" ]]; then | |
CMD+=(\\\"$i\\\") | |
else | |
CMD+=($i) | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Copyright (c) 2013 Adam Knight | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z $1 ]; then | |
echo "usage: `basename $0` /full/path/to/MYPROJ-Info.plist font1.(ttf|otf) [font2 font3 ...] #names of font files" | |
exit 1 | |
fi | |
PLIST=$1 | |
shift | |
FONTS=$@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from errno import * | |
class SymlinkKVS(object): | |
def __init__(self, storepath): | |
self.storepath = storepath | |
def __delitem__(self, key): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MAILDIR="~/Maildir" | |
RESULTS="~/Maildir/.SearchResults" | |
mu find -o links --linksdir="${RESULTS}" --clearlinks $@ && mutt -f "${RESULTS}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _HELPER(x) #x | |
#define START_IGNORE_DIAGNOSTIC(diag) _Pragma("clang diagnostic push"); _Pragma(_HELPER(clang diagnostic ignored #diag)); | |
#define STOP_IGNORE_DIAGNOSTIC _Pragma("clang diagnostic pop"); | |
START_IGNORE_DIAGNOSTIC(-Wsomething-stupid) | |
somethingSeeminglyStupid(); | |
STOP_IGNORE_DIAGNOSTIC |
NewerOlder