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
/* Abstract event binding | |
Example: | |
var MyEventEmitter = function(){}; | |
MyEventEmitter.prototype = new AbstractEventsDispatcher; | |
var emitter = new MyEventEmitter(); | |
// Bind to single event | |
emitter.bind('foo_event', function(data){ alert(data)} ); |
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
require 'sproutcore' | |
require 'sproutcore-statechart' | |
require 'sproutcore-routing' | |
App = SC.Application.create() | |
App.GlobalNavController = SC.Object.create( | |
home: -> App.statechart.gotoState 'home' | |
about: -> App.statechart.gotoState 'about' | |
) |
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
<head > | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script> | |
<script type="text/javascript"> | |
function PhoneListCtrl($scope, $http){ | |
var dataurl ='http://gdata.youtube.com/feeds/api/videos?q="string%20calculator"%20kata%20-tekpub%20-movie&orderby=rating&alt=json'; | |
$http.get(dataurl).success(function(data){ |
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)pulseView:(UIView *)view completion:(void (^)(void))block { | |
// if you use auto layout, view-based transform go haywire, as they trigger layoutSubviews | |
// consequence is that you have no idea where the view will end up on the screen once animation completes | |
// see this discussion: http://stackoverflow.com/questions/12943107/how-do-i-adjust-the-anchor-point-of-a-calayer-when-auto-layout-is-being-used | |
// thus (per solution 4 from link above), rewriting with CAKeyframeAnimation | |
CAKeyframeAnimation *ka = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; | |
ka.duration = .49; |
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
#define SR_WEAK(obj) __typeof__(obj) __weak | |
#define SR_WEAK_SELF SR_WEAK(self) | |
// Usage: | |
// SR_WEAK_SELF weakSelf = self; |
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
// | |
// UIImageView+Webcache_Animation.m | |
// Tubesmix | |
// | |
// Created by Cherif YAYA on 17/03/13. | |
// Copyright (c) 2013 Cherif YAYA. All rights reserved. | |
// | |
#import "UIImageView+Webcache_Animation.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
// | |
// NSColor+CGColor.m | |
// | |
// Created by Michael Sanders on 11/19/10. | |
// | |
#import "NSColor+CGColor.h" | |
@implementation NSColor (CGColor) |
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 HTTPS = require('https'); | |
var QueryString = require('querystring'); | |
/** | |
* Facebook API Wrapper | |
* @constructor | |
* @param {Object} info Info about the Facebook application | |
*/ | |
var Client = function (info) { | |
if (!info.id) { |
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)downloadFile:(id)sender { | |
NSURL *url = [NSURL URLWithString:@"http://www.hulkshare.com/dl/qw30o7x373a8/stan_courtois_&_felly_vs_cutting_crew_-_die_in_your_arms_(x-centrik_mix)_%5B_www.themusix.net_%5D.mp3"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
NSString *fullPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[url lastPathComponent]]; | |
[operation setOutputStream:[NSOutputStream outputStreamToFileAtPath:fullPath append:NO]]; |
OlderNewer