Skip to content

Instantly share code, notes, and snippets.

//
// SemiAppDelegate.m
// Sidebar Test 2
//
// Created by Caylan Larson on 2/19/14.
// Copyright (c) 2014 Semireg Industries. All rights reserved.
//
#import "SemiAppDelegate.h"
#import "ConstraintPack.h"
//
// NSView+ConstraintPack.h
// Sidebar Test 2
//
// Created by Caylan Larson on 2/19/14.
// Copyright (c) 2014 Semireg Industries. All rights reserved.
//
#import <Cocoa/Cocoa.h>
ConstraintsRemove (void) remove;
ConstraintPreparationForView void PrepareViewForAutoLayout(VIEW_CLASS *view);
ConstraintsInstall void InstallConstraints(NSArray *constraints, NSUInteger priority);
ConstraintsRemove void RemoveConstraints(NSArray *constraints);
ConstrainToSuperview void ConstrainToSuperview(VIEW_CLASS *view, CGFloat inset, NSUInteger priority);
ConstrainMinimumSize void ConstrainMinimumViewSize(VIEW_CLASS *view, CGSize size, NSUInteger priority);
ConstrainMaximumSize
ConstrainSize
void SizeView(VIEW_CLASS *view, CGSize size, NSUInteger priority);
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSView *contentView = self.window.contentView;
contentView.SE_nametag = @"Content View";
NSView *sidebarView = [[NSView alloc] init];
sidebarView.SE_backgroundColor = [NSColor greenColor];
PREPCONSTRAINTS(sidebarView);
sidebarView.SE_nametag = @"Sidebar View";
$ apportable load
Building with TARGET_ARCH_ABI:armeabi ARM_NEON:False
Building to /Users/i/.apportable/SDK/Build/android-armeabi-debug
Loading configuration.
Finished parsing configuration.
scons: Building targets ...
Compiling /Users/i/dev/Xcode/My Journal/My Journal/CoreDataTVC.m
Compiling /Users/i/dev/Xcode/My Journal/My Journal/Lumberjack/DDASLLogger.m
Compiling /Users/i/dev/Xcode/My Journal/My Journal/Lumberjack/DDFileLogger.m
/Users/i/dev/Xcode/My Journal/My Journal/CoreDataTVC.m:20:40: error: no visible @interface for 'NSManagedObjectContext' declares the selector
@semireg
semireg / gist:7493380
Last active December 28, 2015 11:29
Using jekyll for a website with two-levels of navigation. This is one step closer to dynamic front-matter.

_data/nav.yml

LabelScope:
  alt: Tour
  subdirs:
    - Download
    - Support
    - Printers

MASS:
Device: 0x100502930 = { DYMO - M10 10 lb Digital Postal Scale, vendorID: 0x0922, productID: 0x8003, usage: 0x008D:0x0020, Transport: "USB", version: 256, SerialNumber: "0000000030740", locationID: 0x14200000, MaxInputReportSize: 6, MaxOutputReportSize: 2, MaxFeatureReportSize: 2, ReportInterval: 32000, }
Element: 0x10010f0b0 = { parent: 0x0, cookie: 0x1, type: Application Collection, usage: 0x008D:0x0020, report: { ID: 0, Size: 0, Count: 1 }, isArray, hasPreferredState, }
Element: 0x100112630 = { parent: 0x10010f0b0, cookie: 0x2, type: Logical Collection, usage: 0x008D:0x0030, report: { ID: 0, Size: 0, Count: 1 }, isArray, hasPreferredState, }
Element: 0x1001131d0 = { parent: 0x100112630, cookie: 0x3, type: Logical Collection, usage: 0x008D:0x0027, report: { ID: 0, Size: 0, Count: 1 }, isArray, hasPreferredState, }
Element: 0x100113250 = { parent: 0x1001131d0, cookie: 0x25, type: Feature, usage: 0x008D:0xFFFFFFFF, report: { ID: 1, Size: 8, Count: 1 }, logical: {min: 1, max: 10}, physical
int main(int argc, char *argv[])
{
//XYZPerson *person = [[XYZPerson alloc] init];
XYZPerson *person = [XYZPerson person];
if(person)
{
NSLog(@"Person is alive: %@", person);
[person sayHello];
}else{
NSLog(@"No person, sorry!");
@semireg
semireg / gist:5156040
Created March 13, 2013 20:52
The goal is to make the screen printcmd bidirectional. That is, the output from printcmd should be sent back to the remote (host) terminal.
Open 4 terminals, A (host), B (client), C (print log), and D (socat).
Create file ~/.screenrc and include line:
printcmd "/tmp/screenprint.sh"
Create file /tmp/screenprint.sh and make executable with contents:
#!/bin/bash
echo "Started"