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
meteor create --example todos | |
meteor bundle myapp.tgz | |
tar xzf myapp.tgz | |
cd bundle | |
(create package json with settings below) | |
jitsu databases create mongo <dbname> | |
(grab dbstring) | |
jitsu env set PORT 3000 | |
jitsu env set MONGO_URL <dbstring> | |
jitsu deploy |
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
var fs = require('fs'), | |
querystring = require('querystring'), | |
redis = require('redis'), | |
r = redis.createClient(), | |
allowedTypes = { | |
'text/javascript': 'js', | |
'text/css': 'css', | |
'image/png': 'png', | |
'image/jpeg': 'jpg', |
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
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
for (UIControl *control in self.view.subviews) { | |
if ([control isKindOfClass:[UITextField class]]) { | |
[control endEditing:YES]; | |
} | |
} | |
} |
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
- (void)configureCameraForHighestFrameRate:(AVCaptureDevice *)device | |
{ | |
AVCaptureDeviceFormat *bestFormat = nil; | |
AVFrameRateRange *bestFrameRateRange = nil; | |
for ( AVCaptureDeviceFormat *format in [device formats] ) { | |
for ( AVFrameRateRange *range in format.videoSupportedFrameRateRanges ) { | |
if ( range.maxFrameRate > bestFrameRateRange.maxFrameRate ) { | |
bestFormat = format; | |
bestFrameRateRange = range; | |
} |
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
// | |
// NSArray+BinarySearch.h | |
// BinarySearch | |
// | |
// Created by Ole Begemann on 19.04.10. | |
// Copyright 2010 Ole Begemann. All rights reserved. | |
// | |
#import <Foundation/Foundation.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
CVImageBufferRef cvImage = CMSampleBufferGetImageBuffer(sampleBuffer); | |
CIImage *ciImage = [[CIImage alloc] initWithCVPixelBuffer:cvImage]; |
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
let notificationCenter = NSNotificationCenter.defaultCenter() | |
notificationCenter.addObserver( | |
self, | |
selector: "textFieldTextChanged:", | |
name:UITextFieldTextDidChangeNotification, | |
object: nil | |
) | |
func textFieldTextChanged(sender : AnyObject) { | |
sendButton.enabled = messageField.text.utf16count > 0 |
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
// Developer/Library/Frameworks/SenTestingKit.framework/Headers/SenTestCaseRun.h | |
SENTEST_EXPORT NSString * const SenTestCaseDidStartNotification; | |
SENTEST_EXPORT NSString * const SenTestCaseDidStopNotification; | |
SENTEST_EXPORT NSString * const SenTestCaseDidFailNotification; | |
// Developer/Library/Frameworks/SenTestingKit.framework/Headers/SenTestDistributedNotifier.h | |
SENTEST_EXPORT NSString * const SenTestNotificationIdentifierKey; | |
// Developer/Library/Frameworks/SenTestingKit.framework/Headers/SenTestSuiteRun.h | |
SENTEST_EXPORT NSString * const SenTestSuiteDidStartNotification; |
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
Here is what you need to do to register your app for a custom URL scheme (for the example we will use a "myapp" scheme). | |
1) In your Info.plist, add a new entry for CFBundleURLTypes: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>MyApp's URL</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> </array> | |
2) Somewhere in your application's startup code (e.g. init), add this code: - (void)registerMyApp { [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(getUrl:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; } | |
- (void)getUrl:(NSAppleEventDescriptor )event withReplyEvent:(NSAppleEventDescriptor )replyEvent { NSString url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; // Now you can parse the URL and perform whatever action is needed } | |
Related Tidbits: |
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
(pv -n $INPUT_DISK_IMAGE | dd of=/dev/$OUTPUT_DISK_ID bs=2m conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0 |
OlderNewer