Skip to content

Instantly share code, notes, and snippets.

View stuffmc's full-sized avatar

StuFF mc stuffmc

View GitHub Profile
// curl -X POST -H "Content-Type: body=application/json" -d '{"logs":["xyz"]}' https://example.com/v1/log
$cont = file_get_contents('php://input');
echo "cont: $cont\n"; // Outputs cont: {"logs":["xyz"]}
$log = json_decode($cont);
echo "log: $log\n"; // Never outputed. Even not "log:"
<html>
<head>
function onload() {
document.getElementById('my-frame').onload = function() {
console.log('iframe loaded');
}
</script>
</head>
<body onload="onload();">
UI- and App Frameworks Evangelist - Jake Behrens, [email protected], twitter: @Behrens
- What's new in Cocoa
- Accessibility in iOS
- Building User Interfaces for iOS 7
- Getting Started with UIKit Dynamics
- What's new in Cocoa Touch
- What's New With Multitasking
- Best Practices for Cocoa Animation
- Improving Power Efficiency with App Nap
- Introducing Text Kit
workspace 'Foo'
target :Foo_Mac do
xcodeproj 'Mac/Foo_Mac'
platform :osx
pod 'HockeySDK-Mac'
end
target :Foo_iOS do
xcodeproj 'Foo_iOS'
Pod::Spec.new do |s|
s.name = "Log4Cocoa"
s.version = "0.0.1"
s.summary = "Log4j port for iOS and Mac OS X."
s.homepage = "https://github.com/endSly/Log4Cocoa"
s.license = 'All rights reserved.'
s.author = { "Manuel 'StuFF mc' Carrasco Molina" => "[email protected]", "Endika Gutiérrez Salas" => "", "Timothy Reaves" => "", "Bob Frank" => "", "Michael James" => "" }
s.source = { :git => "https://github.com/endSly/Log4Cocoa.git", :tag => s.version.to_s }
s.source_files = 'Log4Cocoa', 'Log4Cocoa/**/*.{h,m}'
s.requires_arc = false
// @samvermette How do you explain this code crashing in [SVPullToRefreshView .cxx_destruct]?
MasterViewController *SELF = self;
[self.tableView addPullToRefreshWithActionHandler:^{
[SELF pullToRefreshHandler];
}];
@stuffmc
stuffmc / gist:5271713
Created March 29, 2013 15:54
RAPageViewControllerSubclass code necessary for getting scrollsToTop back at work. Unless @evadne sees a better solution.
- (void)viewDidLoad {
[super viewDidLoad];
[self scrollView].scrollsToTop = NO;
[self scrollView].delegate = self;
...
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
[super scrollViewDidEndDecelerating:scrollView];
<style>
img {
width: 100%;
}
</style>
<table width="100%"><tr align="center">
<td>
<img src="http://extern.volkswagen-nutzfahrzeuge.de/common/farben_flash/fahrzeugbilder/caddy_comfortline_gp/pop_up/candyweiss.jpg"><br>Candy White<br>
<img src="http://extern.volkswagen-nutzfahrzeuge.de/common/farben_flash/fahrzeugbilder/caddy_comfortline_gp/pop_up/salsared.jpg"><br>Salsa Red<br>
GTMOAuth2ViewControllerTouch *viewController = [GTMOAuth2ViewControllerTouch controllerWithScope:scope
clientID:CLIENT_ID
clientSecret:CLIENT_SECRET
keychainItemName:kKeychainItemName
completionHandler:completionHandler];
UIViewController *parentViewController = viewController;
if (![self.delegate isKindOfClass:[UINavigationController class]]) {
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];
self.navigationController.navigationBar.translucent = YES;
@stuffmc
stuffmc / composition.m
Created January 6, 2012 21:59
AVComposition & AVVideoComposition
// For whatever reason (I guess because my code is wrong) the "composition" returns twice the same asset (one transformed, one not),
// although it should display 2 different videos... If anybody has a clue :(
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], AVURLAssetPreferPreciseDurationAndTimingKey, nil];
AVMutableComposition *composition = [AVMutableComposition composition];
CMTimeRange timeRange = CMTimeRangeMake(kCMTimeZero, CMTimeMakeWithSeconds(4, 1));
AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition];
// Track B