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
### JSTN | |
jstn.vt220.19200:\ | |
:cb:ce:ck:lc:fd#1000:hw:ht:np:sp#19200:tt=vt220:im=\r\n . .o8 oooo\r\n .o8 "888 `888\r\n.o888oo oooo oooo ooo. .oo. .oo. 888oooo. 888 oooo d8b\r\n 888 `888 `888 `888P"Y88bP"Y88b d88' `88b 888 `888""8P\r\n 888 888 888 888 888 888 888 888 888 888\r\n 888 . 888 888 888 888 888 888 888 888 888 .o.\r\n "888" `V88V"V8P' o888o o888o o888o `Y8bod8P' o888o d888b Y8P\r\n\r\n\r\n%s %r %m (%t)\r\n%h\r\n\r\n: | |
### |
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
/* | |
`arc4random_uniform` is very useful but limited to `UInt32`. | |
This defines a generic version of `arc4random` for any type | |
expressible by an integer literal, and extends some numeric | |
types with a `random` method that mitigates for modulo bias | |
in the same manner as `arc4random`. | |
`lower` is inclusive and `upper` is exclusive, thus: | |
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
// JSTN / 10 June 2014 | |
// I really like Swift so far, but I can't help be a little sad that I still find | |
// myself doing the weakSelf/strongSelf dance to avoid retain cycles. | |
// For a contrived example, suppose we had a class like this with a queue: | |
import Foundation | |
class ParallelMessenger { |
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
- (NSTimeInterval)frameRateForMovie:(QTMovie *)movie | |
{ | |
for (QTTrack *track in [movie tracks]) { | |
QTMedia *media = [track media]; | |
if (![media hasCharacteristic:QTMediaCharacteristicHasVideoFrameRate]) | |
continue; | |
QTTime duration = [(NSValue *)[media attributeForKey:QTMediaDurationAttribute] QTTimeValue]; | |
long sampleCount = [(NSNumber *)[media attributeForKey:QTMediaSampleCountAttribute] longValue]; | |
return sampleCount * ((NSTimeInterval)duration.timeScale / (NSTimeInterval)duration.timeValue); | |
} |
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
#include "JXBezier.h" | |
#include <math.h> | |
JXUnitBezier JXUnitBezierMake(double p1x, double p1y, double p2x, double p2y) { | |
JXUnitBezier bezier; | |
bezier.cx = 3.0 * p1x; | |
bezier.bx = 3.0 * (p2x - p1x) - bezier.cx; | |
bezier.ax = 1.0 - bezier.cx - bezier.bx; | |
bezier.cy = 3.0 * p1y; | |
bezier.by = 3.0 * (p2y - p1y) - bezier.cy; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>1 1 1 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Monaco - 12.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>1 1 1 1</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
/* | |
JSTN THEME FOR LIMECHAT 1.0 | |
put this and the other thing in ~/Library/Application Support/LimeChat/Themes/ | |
bg 1a2230 | |
hlight 273146 | |
red e44347 | |
purps 8b84d0 | |
fuscia c2339a |
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
# howisobamadoing.com / howisromneydoing.com | |
# (c) justinouellette.com MMXII | |
require 'rubygems' | |
require 'sinatra' | |
CACHE_TIME = 3600 # one hour | |
OBAMA_DATA_PATH = 'obama.txt' | |
ROMNEY_DATA_PATH = 'romney.txt' |
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
NSString *imagePath = @"/tmp/test.jpg"; | |
CGDataProviderRef imageDataProvider = CGDataProviderCreateWithFilename([imagePath UTF8String]); | |
CGImageRef image = CGImageCreateWithJPEGDataProvider(imageDataProvider, NULL, false, kCGRenderingIntentDefault); | |
CGDataProviderRelease(imageDataProvider); | |
size_t bytesPerPixel = 4; | |
size_t bitsPerComponent = 8; | |
size_t imageWidth = CGImageGetWidth(image); | |
size_t imageHeight = CGImageGetHeight(image); |
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
<!-- | |
scaling background, as seen on normative.com | |
--> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Scaling Background</title> | |
<meta name="warning" content="HC SVNT DRACONES" /> | |
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/reset/reset-min.css" /> |