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
let stream = CGDisplayStream(display: CGDirectDisplayID(), outputWidth: 1, outputHeight: 1, pixelFormat: Int32(kCVPixelFormatType_32BGRA), properties: nil, handler: { (status, time, surface, update) in | |
// do nothing | |
}) |
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
https://youtu.be/-C-JoyNuQJs?t=39m45s | |
When I put the reference implementation onto the website I needed to | |
put a software license on it. | |
And I looked at all the licenses that were available, and there were a lot | |
of them. And I decided that the one I liked the best was the MIT License, | |
which was a notice that you would put on your source and it would say, | |
"you're allowed to use this for any purpose you want, just leave the | |
notice in the source and don't sue me." |
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
# create an UDP server using nc on port 11090 | |
nc -ul 11090 | |
# check whether an UDP server is listening on 11190 | |
nc -vz -u <hostname> 11090 | |
# send a packet to the UDP server | |
echo -n "hello" | nc -4u -w1 <hostname> 1118 |
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 xcrun swift -i | |
import Foundation | |
import Darwin.ncurses | |
initscr() // Init window. Must be first | |
cbreak() | |
noecho() // Don't echo user input | |
nonl() // Disable newline mode | |
intrflush(stdscr, true) // Prevent flush |
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 swift | |
// Run this command line tool as a dynamic script or compile a binary | |
// using the following command: | |
// swiftc -sdk `xcrun --show-sdk-path` LocateMe.swift | |
import Cocoa | |
import CoreLocation | |
extension String { |
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 xcrun swift | |
import Foundation | |
struct Teammate { | |
let name: String | |
let weighting: Int | |
} | |
let teammates = [ |