This file contains hidden or 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 'rubygems' | |
require "#{File.dirname(__FILE__)}/../../lib/agent_xmpp" | |
########################################################################################################## | |
# before filters | |
#......................................................................................................... | |
# only online contacts can send command messages | |
before :command => :all do | |
jid = params[:from] |
This file contains hidden or 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
xmpp_pubsub_messages.xml | |
*** get user disc#info | |
<iq to='[email protected]' id='disco1' type='get'> | |
<query xmlns='http://jabber.org/protocol/disco#info'/> | |
</iq> | |
*** create [email protected] pubsub root node (sent from account [email protected]) | |
<iq id='29293' to='pubsub.somewhere.com' type='set' xmlns='jabber:client'> |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'fog' | |
config = YAML.load(File.read(ARGV[0])) | |
volumes_to_snap = YAML.load(File.read(ARGV[1])) | |
time = Time.now | |
puts "\nCreating snaps #{time.to_s}" |
This file contains hidden or 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
def symbolize_keys!(thing) | |
case thing | |
when Array | |
thing.each{|v| symbolize_keys!(v)} | |
when Hash | |
thing.symbolize_keys! | |
thing.values.each{|v| symbolize_keys!(v)} | |
end | |
end |
This file contains hidden or 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
@interface NSArray (Extensions) | |
- (NSArray *)mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block; | |
@end | |
@implementation NSArray (Extensions) | |
- (NSArray *)mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block { | |
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[self count]]; |
This file contains hidden or 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 <objc/runtime.h> | |
@interface NSObject (Extensions) | |
- (NSString*)className; | |
@end | |
@implementation NSObject (Extensions) |
This file contains hidden or 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 "NSObject+Extensions.h" | |
@interface UIView (Extensions) | |
+ (UIView*)loadView:(Class)_viewClass; | |
@end | |
@implementation UIView (Extensions) |
This file contains hidden or 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 <UIKit/UIKit.h> | |
@protocol ParameterSliderViewDelegate; | |
@interface ParameterSliderView : UIView | |
@property(nonatomic, weak) id<ParameterSliderViewDelegate> delegate; | |
@property(nonatomic, strong) UIView* parameterView; | |
@property(nonatomic, strong) UIView* parameterViewBorder; | |
@property(nonatomic, strong) UIPanGestureRecognizer* panGesture; |
This file contains hidden or 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 <Foundation/Foundation.h> | |
@interface UIImage (Extensions) | |
+ (UIImage*)blankImage:(CGSize)_size; | |
+ (UIImage*)blankImage:(CGSize)_size withColor:(UIColor*)_color; | |
@end |
This file contains hidden or 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
function settitle() { echo -ne "\e]2;$@\a\e]1;$@\a"; } |
OlderNewer