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
// Adapted from: | |
// http://techgurka.blogspot.com/2013/04/quick-temperature-graph-using-electric.html | |
class TemperatureSensor { | |
i2cPort = null; | |
constructor(port) { | |
i2cPort = port; | |
i2cPort.configure(CLOCK_SPEED_100_KHZ); | |
} | |
// Retrieve temperature (from local sensor) in deg F |
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
// Adapted from: | |
// http://techgurka.blogspot.com/2013/04/quick-temperature-graph-using-electric.html | |
class TemperatureSensor { | |
i2cPort = null; | |
constructor(port) { | |
i2cPort = port; | |
i2cPort.configure(CLOCK_SPEED_100_KHZ); | |
} | |
// Retrieve temperature (from local sensor) in deg F |
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
setPoint <- 68; | |
function updateTemp() { | |
// Read the ambient temperature | |
temp <- readTemp(); | |
// If it's below what it should be, turn on the heat. | |
if (temp < setPoint) { | |
heatOn(); | |
} else { |
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
def inlineme(f: => Int): Int = { | |
try { | |
f | |
inlineme { | |
return 0 | |
} | |
} catch { | |
case ex: Throwable => println(ex); return 1 | |
} | |
} |
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
INKBlob *blob = [INKBlob blobFromData:content]; | |
blob.uti = @"public.png" | |
[myView INKEnableWithBlob:blob]; |
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
{ | |
"actions": [ | |
{...}, | |
{...}, | |
{ | |
"id": 2, | |
"uuid": "abcdefg", | |
"name": "Sign in PDFSign", | |
"call_to_action": "Sign", | |
"description": "This will save a file", |
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
if ([INK appShouldReturn]) { | |
// 3 choices (choose 1) | |
// Return with data unchanged | |
[Ink return]; | |
// Return with updated data | |
[INK returnBlob:newBlob]; | |
// Return with error: (You must indicate to the user what went wrong before calling this) |
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
// Get the UUID for your action from the developer portal | |
INKAction *store = [INKAction actionWithUUID:@"store-asdfasd-sdfads"]; | |
[Ink registerAction:store withTarget:self selector:@selector(storeBlob:action:error:)]; | |
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
{ | |
"actions": [ … ], | |
"leftActions": [ | |
{...}, | |
{...}, | |
{ | |
"id": 4, | |
"uuid": "abcdefg", | |
"name": "Return to Frame", | |
"call_to_action": "Return", |
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
INKAction *returnAction = [INKAction action:@"Return" type:INKActionType_Return]; | |
[INKCore registerAction:returnAction withBlock:^(INKBlob *blob, NSError *error) { | |
NSLog(@"Return"); | |
//Code to handle the returned blob | |
}]; | |
INKAction *returnCancelAction = [INKAction action:@"ReturnCancel" type:INKActionType_ReturnCancel]; | |
[INKCore registerAction:returnCancelAction withBlock:^(INKBlob *blob, NSError *error) { | |
NSLog(@"Return Cancel"); | |
}]; |