Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
// | |
// StoryboardExtensionsBeta4Fix.swift | |
// | |
// A workaround so that you can use SplitView | |
// and TabView items in OS X Storyboards on | |
// 10.10. Just drop this in your Swift project. | |
// | |
// Hopefully the need for this goes away in soon | |
// as it used to work. |
#import <Foundation/Foundation.h> | |
#define ARC4RANDOM_MAX 0x100000000 | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
long double hit = 0; |
// Speed limiter | |
- (void)shipSpeedLimit { | |
// Check the x velocity | |
if (self.ship.physicsBody.velocity.dx > 500) { | |
self.ship.physicsBody.velocity = CGVectorMake(500, self.ship.physicsBody.velocity.dy); | |
} else if (self.ship.physicsBody.velocity.dx < -500) { | |
self.ship.physicsBody.velocity = CGVectorMake(-500, self.ship.physicsBody.velocity.dy); | |
} | |
func getUptime() -> Int { | |
let nanoseconds = DispatchTime.now() | |
return Int(nanoseconds.rawValue / 1000000000) | |
} |
import Foundation | |
// Code-golf version | |
let inputFile = URL(fileReferenceLiteralResourceName: "input.txt") | |
print(try! String(contentsOf: inputFile).components(separatedBy: .newlines).compactMap { Float($0) }.map { Int(($0 / 3).rounded(.down) - 2) }.reduce(0, +)) | |
// Fancy version | |
typealias ModuleHopper = [Module] | |
typealias MassCalculations = [Float] |
import Cocoa | |
typealias IntcodeProgram = [Int] | |
func loadInput() throws -> IntcodeProgram { | |
do { | |
let inputFile = URL(fileReferenceLiteralResourceName: "input.txt") | |
let rawInput = try String(contentsOf: inputFile) | |
let splitFile = rawInput.components(separatedBy: .punctuationCharacters) | |
return splitFile.compactMap { Int($0) } |
alias anka='sudo /usr/local/bin/anka' | |
alias ankacluster='sudo /usr/local/bin/ankacluster' | |
alias clusterjoin='sudo ankacluster join http://<YOUR_CONTROLLER> -m 3 -H `hostname`' | |
alias clusterdisjoin='sudo ankacluster disjoin' | |
alias lsvm='sudo anka list' |
Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
#!/bin/zsh | |
zparseopts -E -D -- D:=DOMAIN -domain:=DOMAIN d=DNS -dns=DNS | |
DOMAIN=$DOMAIN[2] | |
DNS=$DNS | |
if [[ -z $DOMAIN ]]; then | |
echo "adlookupos.sh: Troubleshoot DNS service records needed for AD." | |
echo "\nUsage: adlookups.sh [-d] [-D domain]" |
import Foundation | |
// Playground for exploring memory layout in Swift. | |
// A simple struct | |
struct Foo { | |
let a: Int? | |
let b: Int? | |
var isTrue = true | |
} |