Skip to content

Instantly share code, notes, and snippets.

@KevinDoughty
KevinDoughty / gist:5278257
Last active December 15, 2015 14:59
test
// test
NSRect theRect = [theTextContainer lineFragmentRectForProposedRect:proposedRect sweepDirection:sweepDirection movementDirection:movementDirection remainingRect:remainingRect];
NSLog(@"This is your rect:%@;",NSStringFromRect(theRect));
@KevinDoughty
KevinDoughty / subpixelAntiAliasing
Last active August 29, 2015 13:56
Experiments with subpixel antialiasing of NSTextField without a background. Still not correct, text appears lighter and thinner.
-(void)drawInteriorWithFrame:(NSRect)theControlViewBounds inView:(NSView*)theControlView {
if (!self.isEditing) {
NSLog(@"%@ drawInteriorWithFrame:%@; inView:%@;",self, NSStringFromRect(theControlViewBounds),theControlView);
self.isEditing = YES;
NSTextView *theTextView = [self textDrawingObject];
NSTextContainer *theTextContainer = [theTextView textContainer];
NSLayoutManager *theLayoutManager = [theTextContainer layoutManager];
NSTextStorage *theTextStorage = [theLayoutManager textStorage];
NSRange theOldGlyphRange = NSMakeRange(0, [theLayoutManager numberOfGlyphs]);
NSRange theOldCharacterRange = [theLayoutManager characterRangeForGlyphRange:theOldGlyphRange actualGlyphRange:nil];
#!/opt/local/bin/php
<?php
// logs can be viewed with:
// sudo tail -f /opt/local/var/squid/logs/cache.log
$enabled = true;
$verboseLogging = true;
$upsideDownTernet = false;
$negativeLand = true;
function abomination(InnerComponent) {
const Subclass = (function(SuperComponent) {
function Subclass() {
SuperComponent.prototype.constructor.apply(this,arguments);
}
Subclass.prototype = Object.create(SuperComponent.prototype);
Subclass.prototype.componentDidMount = function() {
if (SuperComponent.prototype.componentDidMount) {
SuperComponent.prototype.componentDidMount.apply(this,arguments);