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
git init | |
mkdir vendor | |
git submodule add git://github.com/kriswallsmith/assetic.git vendor/assetic | |
mkdir vendor\bundles\JMS | |
git submodule add https://github.com/schmittjoh/SecurityExtraBundle.git vendor/bundles/JMS/SecurityExtraBundle | |
mkdir vendor\bundles\Sensio\Bundle |
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
- (NSMutableDictionary *)throttleActionHash | |
{ | |
NSMutableDictionary *throttleData = objc_getAssociatedObject(self, THROTTLE_ACTION_HASH_PROPERTY_KEY); | |
if (!throttleData) { | |
throttleData = [[NSMutableDictionary alloc] init]; | |
objc_setAssociatedObject(self, THROTTLE_ACTION_HASH_PROPERTY_KEY, throttleData, OBJC_ASSOCIATION_RETAIN); | |
} | |
return throttleData; |
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
// Assume we have an NSPersistentStoreCoordinator which has been initialised with our entity model, and | |
// an NSURL which points to our store's location on disk | |
NSDictionary *sourceMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:storeUrl options:options error:&error]; | |
NSManagedObjectModel *destinationModel = coordinator.managedObjectModel; | |
BOOL storeIsCompatible = [destinationModel isConfiguration:nil compatibleWithStoreMetadata:sourceMetadata]; |
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
// Create a progress bar view | |
UIProgressView *progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; | |
progressView.progress = 0; | |
// Assume we have a progress object | |
NSProgress *progress = [self progressForOngoingTask]; | |
// Observe the 'fractionCompleted' property and update the progress view as it changes | |
[self.KVOController observe:progress keyPath:@"fractionCompleted" options:NSKeyValueObservingOptionNew block:^(id _Nullable observer, id _Nonnull object, NSDictionary<NSString *, id> *_Nonnull change) { | |
dispatch_async(dispatch_get_main_queue(), ^{ |
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
NSURL *pathToPdfFile; | |
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[ result ] applicationActivities:nil]; | |
NSMutableArray *excludedActivities = [NSMutableArray array]; | |
NSNumber *emailOutEnabled = [self.userPreferences.featureFlags valueForKeyPath:@"research.share.email"]; | |
if (!emailOutEnabled.boolValue) { | |
[excludedActivities addObject:UIActivityTypeMail]; | |
} |
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
<?php | |
namespace Acme\DemoBundle\Handler; | |
use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler; | |
use Symfony\Component\Security\Core\Exception\AuthenticationException; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
class XHRAuthenticationFailureHandler extends DefaultAuthenticationFailureHandler |
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 javax.swing.*; | |
import java.awt.event.*; | |
import java.awt.*; | |
import java.io.*; | |
import java.net.*; | |
import javax.swing.event.*; | |
public class Internet extends JFrame | |
{ | |
final JDesktopPane theDesktop; |
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
@implementation ExampleAssembly | |
- (MyModel *)model { | |
return [TyphoonDefinition withClass:[MyModel class] | |
configuration:^(TyphoonDefinition* definition) { | |
[definition useInitializer:@selector(initWithDependency:) | |
parameters:^(TyphoonMethod *initializer) { | |
[initializer injectParameterWith:[self exampleDependency]]; |
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)interceptSeguesToPerformDependencyInjection { | |
NSError *error; | |
id<AspectToken> DIAspectToken = [UIViewController aspect_hookSelector:@selector(prepareForSegue:sender:) withOptions:AspectPositionBefore usingBlock:^(id<AspectInfo> aspectInfo, UIStoryboardSegue *segue, id sender) { | |
UIViewController *destinationController = segue.destinationViewController; | |
[self.UIAssembly inject:destinationController]; | |
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)showNoteSplitViewWithDataController:(DataController *)dataController searchController:(SearchController *)searchController { | |
NSParameterAssert(dataController); | |
NSParameterAssert(searchController); | |
NSString *authenticatedUserId = self.applicationSessionCredentialStore.userId; | |
NoteSplitViewAssembly *assembly = [self.assembly noteSplitViewAssemblyWithApplicationSession:self.applicationSession dataController:dataController searchController:searchController authenticatedUserId:authenticatedUserId]; | |
[assembly activate]; |