Skip to content

Instantly share code, notes, and snippets.

View amro's full-sized avatar

Amro Mousa amro

View GitHub Profile

Keybase proof

I hereby claim:

  • I am amro on github.
  • I am amro (https://keybase.io/amro) on keybase.
  • I have a public key whose fingerprint is E275 83F3 7B21 7499 473E 6FD7 BA4E 3C06 84A3 1625

To claim this, I am signing this object:

{:order =>
{:id=>193891,
:campaign_id=>"fdajsfd",
:email_id=>"lazar@gmail.com",
:total=>17.44,
:items=>
@amro
amro / gist:52846ea9c6eb3238b793
Last active August 19, 2023 21:56
Using an Instance of NSOrderedSet from Swift
// How one might use NSMutableOrderedSet from Swift -- mainly an example of how to
// call Objective-C classes from Swift. Pretty much what one would expect.
var set = NSMutableOrderedSet()
set.addObject("foo");
set.addObject("bar");
set.addObjectsFromArray(["bar", "wee", "foo"])
for i in 0..set.count {
println(set.objectAtIndex(i))
dispatch_group_t group = dispatch_group_create();
@amro
amro / gist:3294999
Created August 8, 2012 13:24
Rudimentary Android Keystore Password Recovery Script
#!/usr/bin/env ruby
# USE AT YOUR OWN RISK
# This script stops when it hits the correct
# password (you'll see keytool's "New Password:" prompt)
# If it makes it through all permutations without a match,
# then tweak your input. Oh, and it's not particularly fast.
# Note the empty strings at the end of each array to
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
//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;
@amro
amro / batch_sub_test.rb
Created December 9, 2011 16:20
Gibbon List Batch Subscribe Functional Test
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
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
#import "MCTabBarController.h"
@interface MCTabBarController()
- (void)checkAuthStatus;
@end
@implementation MCTabBarController
....
- (void)someMethod {
[self checkAuthStatus];