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
# ruby beginner elevator program | |
# We might break this stuff up into more classes as the need to separate state and | |
# behaviour of different entities emerges, for now we keep it simple and imagine | |
# the state to be that of the building as a whole. | |
# | |
# new code added by calvin... work in progress, still figuring how to make it all work | |
class Building |
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
#!/usr/bin/env ruby -w | |
# frozen_string_literal: true | |
# | |
# usage | |
# chmod +x pinboard_converter.rb | |
# ./pinboard_converter.rb -t [pinboard_export_file] > tag_map.yml | |
# edit tag_map.yml | |
# ./pinboard_converter.rb [pinboard_export_file] tag_map.yml > [roam_import_file] | |
# import [roam_import_file] into Roam |
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
#!/usr/bin/env ruby -w | |
require 'csv' | |
require 'json' | |
require 'ostruct' | |
require 'open-uri' | |
require 'optparse' | |
def setup_options | |
options = OpenStruct.new |
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
#ifdef TARGET_OS_MAC | |
typedef const struct __SecRandom * SecRandomRef; | |
const SecRandomRef kSecRandomDefault = NULL; | |
int SecRandomCopyBytes( SecRandomRef rnd, size_t count, uint8_t *bytes ); | |
int SecRandomCopyBytes( SecRandomRef rnd, size_t count, uint8_t *bytes ) { | |
int fd; |
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
//===--- examples/Fibonacci/fibonacci.cpp - An example use of the JIT -----===// | |
// | |
// The LLVM Compiler Infrastructure | |
// | |
// This file is distributed under the University of Illinois Open Source | |
// License. See LICENSE.TXT for details. | |
// | |
//===----------------------------------------------------------------------===// | |
// | |
// This small program provides an example of how to build quickly a small module |
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
id result = [window callWebScriptMethod:@"testInject" withArguments:[NSArray arrayWithObject:post]]; | |
if( result == WebUndefined ) { <== line 66 | |
NSLog( @"No result" ); | |
} | |
NFNetworkBridge.m:66: error: expected expression before 'WebUndefined' |
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
- (IBAction)debugBindingsAction:(id)sender { | |
NSLog( @" network: %p", _network ); | |
NSLog( @" members: %p", [_network members] ); | |
id object = [[_networkController selectedObjects] objectAtIndex:0]; | |
NSLog( @"selected object: %p", object ); | |
id members = [object valueForKey:@"members"]; | |
NSLog( @" real: %p", members ); | |
} |
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
// .h | |
NSView *_memberView; | |
@property (nonatomic,retain) IBOutlet NSView *memberView; | |
// .m | |
- (void)windowDidLoad { | |
... | |
NSAssert( [self drawer], @"Drawer should not be nil!" ); | |
NSAssert( [self memberView], @"Member View should not be nil when we are setting it!" ); | |
[[self drawer] setContentView:[self memberView]]; |
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
+ (id <ASICacheDelegate>)defaultCache | |
{ | |
@synchronized(self) { | |
return [[defaultCache retain] autorelease]; | |
} | |
} |
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
+ (NSString *)defaultUserAgentString | |
{ | |
@synchronized (self) { | |
if (!defaultUserAgent) { | |
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; | |
// Attempt to find a name for this application | |
NSString *appName = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"]; |
NewerOlder