Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
| /* | |
| Blink | |
| Turns on an LED on for one second, then off for one second, repeatedly. | |
| This example code is in the public domain. | |
| */ | |
| void setup() { | |
| // initialize the digital pin as an output. | |
| // Pin 13 has an LED connected on most Arduino boards: |
| /* | |
| http://arduino.cc/en/Tutorial/AnalogInput | |
| */ | |
| #define SENSOR_PIN A0 // select the input pin for the potentiometer | |
| #define NUM_PINS 8 | |
| #define START_PIN 1 | |
| int pin_interval; |
| [NSNumber numberWithInt:[@"12345" intValue]]; |
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| background: #f06; | |
| background: linear-gradient(45deg, #f06, yellow); | |
| min-height: 100%; |
| - (NSString *)currentDateString { | |
| NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
| [df setDateFormat:@"d"]; | |
| NSString *day = [df stringFromDate:self.currentDate]; | |
| return day; | |
| } | |
| - (NSString *)currentMonthString { | |
| NSDateFormatter *df = [[NSDateFormatter alloc] init]; | |
| [df setDateFormat:@"MMMM"]; | |
| NSString *day = [df stringFromDate:self.currentDate]; |
| heftig: | |
| first, do target = rand(a.inject(0){|m,h| m + h[:prob]}) | |
| to get a value between 0 and (sum of all probs - 1) | |
| then just a.find { |h| target -= h[:prob]; target < 0 } | |
| steps through the array, reducing target by prob until it's < 0 |
| * What is tmux? | |
| * Why tmux? | |
| * tmux vs screen: http://www.wikivs.com/wiki/Screen_vs_tmux | |
| * Install tmux | |
| * brew install tmux | |
| * tmux basics | |
| * leader key (default sucks) | |
| * sessions | |
| * windows | |
| * panes |
| #import <Foundation/Foundation.h> | |
| #import <CoreLocation/CoreLocation.h> | |
| typedef void (^JWLocationManagerCallback)(CLLocation *location); | |
| typedef void (^JWLocationManagerErrorCallback)(NSError *error); | |
| @interface JWLocationManager : NSObject <CLLocationManagerDelegate> | |
| @property (nonatomic, copy) NSString *purpose; | |
| @property (nonatomic, copy) JWLocationManagerCallback locationUpdatedBlock; |
Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.
CS183: Startup—Notes Essay—The Challenge of the Future
Purpose and Preamble
| // Begin the power assertion | |
| IOPMAssertionID assertionID; | |
| IOReturn asserted = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, | |
| kIOPMAssertionLevelOn, | |
| CFSTR("Sandvox Publishing"), | |
| &assertionID); | |
| if (asserted != kIOReturnSuccess) // handle the error; log it or something | |
| // Do your long-running work |