This file contains hidden or 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
// | |
// RecursiveSequence.swift | |
// | |
// Created by John Scott on 31/03/2022. | |
// | |
/// | |
/// To define a sequence by recursion, one needs a rule, called recurrence relation to construct each | |
/// element in terms of the ones before it. In addition, enough initial elements must be provided so | |
/// that all subsequent elements of the sequence can be computed by successive applications of |
This file contains hidden or 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
// | |
// RegularExpression.swift | |
// RegularExpressions | |
// | |
// Created by John Scott on 15/07/2020. | |
// | |
// Original matching implementation Brian Kernighan : https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html | |
// Swift port Ben Cohen : https://github.com/apple/swift/blob/a9eee38e109e3d99f103a9bee71bed4422fbb6fd/benchmark/single-source/StringMatch.swift | |
import Foundation |
This file contains hidden or 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/perl | |
use strict; | |
use Data::Dumper; | |
use Getopt::Long; | |
use File::Temp 'tempdir'; | |
use DirHandle; | |
use File::Slurp; | |
my $tempdir = tempdir(CLEANUP => 1); |
This file contains hidden or 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
// | |
// Optional+SupportsCount.swift | |
// | |
// Created by John Scott on 02/03/2019. | |
// | |
/** | |
This file contains a little syntactic sugar to help the Objective-C oldies. | |
This file contains hidden or 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/perl | |
use strict; | |
use Getopt::Long; | |
warn "Stage\n"; | |
qx(git add -A -v); | |
warn "Commit\n"; | |
qx(git commit -a --allow-empty-message -m '' -v); |
This file contains hidden or 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
// | |
// JJRSIfKind.h | |
// JJRSFoundation | |
// | |
// Copyright © 2018 John Scott ( https://jjrscott.com ) | |
// | |
// This file is MIT licensed. | |
// Usage: ifkind (existing variable, required class name) { ... } | |
#define ifkind(anExistingVariable, aClass) __ifkind(anExistingVariable, aClass, __ifkind_temp(__COUNTER__)) |
This file contains hidden or 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
// | |
// UIViewController+InlineSeques.h | |
// | |
// MIT License | |
// | |
// Copyright © 2018 John Scott. | |
// | |
// 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 |
This file contains hidden or 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/perl | |
# This script builds an archive release of a project. It should be run thus: | |
# $ cd <the project directory> | |
# $ build_project | |
use strict; | |
use Data::Dumper; | |
use Getopt::Long; |
This file contains hidden or 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/perl | |
# | |
# This script will take your nice AppIcon in PDF format and resize it to all the different | |
# sizes inside the AppIcon.appiconset directory. | |
# | |
# Usage example: | |
# | |
# ./pdf2appiconset.pl <AppIcon.appiconset directory> <PDF path> | |
# |
This file contains hidden or 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
CGAffineTransform AffineTransformToPositionOnLines(const CGPoint points[], | |
size_t count, | |
CGFloat position, | |
BOOL rotate) | |
{ | |
CGAffineTransform transform = CGAffineTransformIdentity; | |
if (count > 1) | |
{ | |
for (size_t index = 0;index<count-1;index++) |
NewerOlder