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
{:order => | |
{:id=>193891, | |
:campaign_id=>"fdajsfd", | |
:email_id=>"lazar@gmail.com", | |
:total=>17.44, | |
:items=> |
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
<html> | |
<body> | |
<script type="text/javascript"> | |
var numbers = new Array(); | |
numbers[0] = "1"; | |
numbers[1] = "1"; |
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
//In this example all three run | |
if (...) { | |
} | |
if (...) { | |
} | |
if (...) { | |
} |
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
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
NSString *string = [array objectAtIndex:indexPath.row]; | |
CGSize suggestedSize = [string sizeWithFont:[UIFont systemFontOfSize:15.0] | |
constrainedToSize:CGSizeMake(224.0, FLT_MAX) | |
lineBreakMode:UILineBreakModeWordWrap]; | |
return suggestedSize.height + 40; // add 40px for padding | |
} |
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 foo = ["blah", "hi", "bar"]; | |
for (int i = 0; i < foo.length(); i++) { | |
alert(foo[i]); | |
} |
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 "MCTabBarController.h" | |
@interface MCTabBarController() | |
- (void)checkAuthStatus; | |
@end | |
@implementation MCTabBarController | |
.... | |
- (void)someMethod { | |
[self checkAuthStatus]; |
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 'httparty' | |
require 'json' | |
require 'cgi' | |
require File.join(File.dirname(__FILE__), 'handlers', 'uakari_delivery_handler') | |
class Uakari | |
include HTTParty | |
default_timeout 30 | |
attr_accessor :apikey, :timeout, :options |
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 'gibbon' | |
batch = [] | |
(1..3000).each do |i| | |
batch << {:EMAIL => "foo+#{i.to_s}@gmail.com", :EMAIL_TYPE => "html"} | |
end | |
g = Gibbon.new("YOUR_APIKEY-DC") | |
puts "Response: " + g.list_batch_subscribe({:id =>"YOUR_LIST_ID", :double_optin => "false", :batch => batch, :update_existing => true}).to_s |
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
//Start at negative kWiggleAnimationAngle so we animate to positive kWiggleAnimationAngle | |
view.layer.transform = CATransform3DMakeRotation(-kWiggleAnimationAngle, 0, 0, 1.0); | |
//Setup a transform that will rotate our view to positive kWiggleAnimationAngle | |
CATransform3D transform = CATransform3DMakeRotation(kWiggleAnimationAngle, 0, 0, 1.0); | |
//Setup our animation with the transform | |
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; | |
animation.toValue = [NSValue valueWithCATransform3D:transform]; | |
animation.repeatCount = HUGE_VALF; |
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
u = User.find(id) | |
s = Section.find(section_id) | |
t = Todo.new do |d| | |
d.name = "Finish me" | |
d.due_by = 1.day.ago | |
end | |
u.todos << t | |
s.todos << t |
OlderNewer