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
/* | |
* Author: Landon Fuller <[email protected]> | |
* | |
* Copyright (c) 2008 Plausible Labs. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright |
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
/* | |
* rpm-vercomp.c | |
* RPM compatible version comparison | |
* | |
* Author: Landon J. Fuller <[email protected]> | |
* | |
* Copyright (c) 2002 - 2003 Apple Computer, Inc. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without |
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
from google.appengine.ext import webapp | |
import md5 | |
# XXX Facebook private application key | |
APP_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAA" | |
class FacebookRequestSigner(webapp.RequestHandler): | |
def get(self): | |
method = self.request.get("method") |
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
// Copied from Apple's SeismicXML code sample | |
// When the user taps a row in the table, display the USGS web page that displays details of the earthquake they selected. | |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
Earthquake *earthquake = (Earthquake *)[earthquakeList objectAtIndex:indexPath.row]; | |
PLActionSheet *sheet = [[PLActionSheet alloc] initWithTitle: @"Display Map"]; | |
[sheet addButtonWithTitle: @"Show USGS Site in Safari" block: ^{ | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [earthquake USGSWebLink]]]; | |
}]; |
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
In some cases the type of a method's result may depend on the type of its arguments. | |
To accurately express the signatures of such methods one may use parametric polymorphism. | |
A parametrically polymorphic method signature introduces one or more formal type arguments | |
which can be used throughout the signature and the method body. When the message is sent, | |
the actual types will be inferred and replace the formal type arguments in the signature. | |
As an example, consider the signature of -[NSArray[T] mapArrayUsingBlock:] | |
- (NSArray[X]) mapArrayUsingBlock: (X (^)(T obj) block; | |
The type term X def introduces a type argument X, which will be inferred to be the type returned |
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
#import <sys/stat.h> | |
#import <mach-o/dyld.h> | |
/** | |
* Returns YES if the device is (likely) jailbroken, no otherwise. | |
*/ | |
static BOOL isJailbroken () { | |
int score = 0; | |
/* Check for Cydia/Installer apt */ |
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 <sys/ucontext.h> | |
#include <pthread.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <mach/mach.h> | |
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 <sys/ucontext.h> | |
#include <pthread.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <mach/mach.h> | |
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
/** | |
* Return a block that computes the next value and returns the next stream instance. | |
*/ | |
static PLStreamRemainingBlock NextStream (NSNumber *current) { | |
/** Create a block which will return the next stream value */ | |
PLStreamRemainingBlock f = ^{ | |
PLStreamRemainingBlock remaining; | |
NSNumber *value; | |
/* Create the new stream */ |
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 Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>coop.plausible.backupd-daily</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper</string> | |
</array> |
OlderNewer