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
# Makefile for Mermaid and Graphviz files in this directory | |
# | |
# `make all` - (default target) build all targets | |
# `make png` - build PNGs for all source files | |
# `make svg` - build SVGs for all source files | |
# `make pdf` - build PDFs for all source files | |
# `make clean` - delete all targets | |
# `make listsources` - print list of all input files to be processed | |
# `make listtargets` - print list of all output files |
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
# Init Homebrew shell environment | |
if [ "$(arch)" = 'i386' ]; then | |
[ -e /usr/local/bin/brew ] && eval "$(/usr/local/bin/brew shellenv)" | |
# Force use of Intel dotnet binaries | |
export PATH="/usr/local/share/dotnet/x64:$PATH" | |
echo 'Initialized i386 environment' | |
else # arch = arm64 | |
[ -e /opt/homebrew/bin/brew ] && eval "$(/opt/homebrew/bin/brew shellenv)" | |
echo 'Initialized arm64 environment' | |
fi |
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
import Cocoa | |
func printHexdump(data: Data) { | |
print("\n 0 1 2 3 4 5 6 7 8 9 a b c d e f") | |
print("-----------------------------------------------------------------------------") | |
var i = 0 | |
var bytes: [UInt8] = [] | |
while i < data.count { | |
if i % 16 == 0 { | |
// Write ASCII at end of previous line |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Unzip a set of files to an "unzipped" subdirectory | |
# | |
# Example: | |
# | |
# unzipped *.zip *.tar.gz | |
# | |
# will create the "unzipped" directory if not present, and decompress all the files into that directory. | |
function unzipped { | |
for f in "$@" ; do | |
directory=$(dirname "$f") |
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 python3 | |
"""Test program for argparse module.""" | |
import argparse | |
def main(): | |
parser = argparse.ArgumentParser( | |
description='Test Python argparse module.', | |
epilog='This script doesn\'t do anything useful.' |
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 python3 | |
""" | |
Demonstration of Python standard library textwrap module. | |
Run "python3 wrap_test.py -h" for command-line options. | |
""" | |
import argparse | |
import sys |
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
# Makefile for Mermaid files in this directory | |
# | |
# `make all` - build all targets | |
# `make png` - build PNGs for all source files | |
# `make svg` - build SVGs for all source files | |
# `make pdf` - build PDFs for all source files | |
# `make clean` - delete all targets | |
# `make listsources` - print list of all files to be processed | |
# `make listtargets` - print list of all output files |
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
// Returns current date/time in "yyyy-MM-dd HH:mm:ss.SSSS Z" format using the | |
// system timezone. | |
// | |
// Note that this includes fractional seconds, unlike the system log, so it | |
// is useful when precise times are desired in log output. | |
static NSString* timestampString() | |
{ | |
// Re-use one NSDateFormatter instance for all calls. | |
// NSDateFormatter is thread-safe for iOS 7+. | |
static NSDateFormatter* df; |
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
# Makefile for GraphViz files in this directory | |
# | |
# `make all` - build all targets | |
# `make clean` - delete all targets | |
# `make listtargets` - print list of all targets | |
# `brew install graphviz`, or download from <http://graphviz.org/download/> | |
# to get the `dot` utility. | |
DOT?=dot |
NewerOlder