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
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSHTTPURLResponse *)response { | |
NSURL* redirected_url = [request URL]; | |
NSString* querystr = [redirected_url absoluteString]; | |
if (response != nil) { | |
NSArray* authToken = [NSHTTPCookie cookiesWithResponseHeaderFields:[response allHeaderFields] forURL:[NSURL URLWithString:@""]]; | |
if ([authToken count] > 0) { | |
NSString* dashboard_url = @"https://www.memberselfservice.com/frmDashBoard.aspx"; | |
if ([querystr isEqualToString:dashboard_url]) { |
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)connectionDidFinishLoading:(NSURLConnection *)connection { | |
[connection release]; | |
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; | |
[responseData release]; | |
if (responseString == @"") { | |
[viewController callBackWithMovieDescription:@"failed to load details"]; | |
}else{ | |
NSString* desc = @""; |
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
workon_virtualenv() { | |
if [ -e .git ]; then | |
current_dir="${PWD##*/}" | |
if [ -e ~/virtualenvs/$current_dir ]; then | |
deactivate >/dev/null 2>&1 | |
source ~/virtualenvs/$current_dir/bin/activate | |
fi | |
fi | |
} |
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)animateViewDown:(NSUInteger)size | |
{ | |
[UIView beginAnimations:nil context:NULL]; | |
[UIView setAnimationDuration:0.5]; | |
CGRect rect = self.view.frame; | |
rect.origin.y -= size; | |
rect.size.height += size; | |
self.view.frame = rect; |
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)animateViewDown:(NSUInteger)size | |
{ | |
[self animateView:^(CGRect frame) | |
{ | |
frame.origin.y -= size; | |
frame.size.height += size; | |
return frame; | |
} | |
]; | |
} |
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 httpProxy = require('http-proxy'); | |
var http = require('http'); | |
var express = require('express'); | |
httpProxy.createServer(function (req, res, proxy) { | |
var nodeVhosts = ["www.site.com"] | |
var host = req.headers['host']; | |
var port = nodeVhosts.indexOf(host) > -1 | |
? 8080 |
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 Animal = function(omnivore) { | |
this.omnivore = omnivore; | |
} | |
var human = new Animal(true); | |
console.log("the human is an omnivore " + human.omnivore); | |
//this will print "the human is an omnivore true" |