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
class AvatarUploader < CarrierWave::Uploader::Base | |
# include CarrierWave::RMagick | |
# configure do |config| | |
# config.remove_previously_stored_files_after_update = false | |
# end | |
include Cloudinary::CarrierWave | |
process :convert => 'jpg' #converts all images to pngs |
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
#!/usr/bin/ruby -rubygems | |
# | |
# Point appcrush at an .ipa file from the iTunes AppStore and it | |
# - expands the zip file | |
# - finds all the images | |
# - runs pngcrush with the revert-iphone-optimizations option on each image | |
# | |
# Requirements Xcode with iOS SDK 3.2 or higher | |
# | |
# Usage: appcrush '/Users/boctor/Music/iTunes/Mobile Applications/iBooks.ipa' |
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
# Usage: redis-cli publish message.achannel hello | |
require 'sinatra' | |
require 'redis' | |
conns = Hash.new {|h, k| h[k] = [] } | |
Thread.abort_on_exception = true | |
get '/' do |
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
# Usage: redis-cli publish message hello | |
require 'sinatra' | |
require 'redis' | |
conns = [] | |
get '/' do | |
erb :index | |
end |
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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@end |
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
#pragma mark - Logging User Session Info | |
- (void)logToServer:(NSString *)reason thisInfo:(NSDictionary *)data | |
{ | |
UIDevice *device = [UIDevice currentDevice]; | |
NSString *deviceName = [device model]; | |
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; | |
NSString *userId = [NSString stringWithFormat:@"%d", self.getMyUserId]; | |
NSString *liveEventId = [NSString stringWithFormat:@"%d", self.getEventId]; |
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
#pragma mark get user agent | |
+ (NSString *)defaultUserAgentString | |
{ | |
@synchronized (self) { | |
if (!defaultUserAgent) { | |
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; |
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
/* | |
XBeeCableReplacement.pde | |
Control the color of an RGB LED wirelessly via XBee. | |
Required (in addition to your Arduino): | |
(These items are found in the SparkFun XBee Wireless Kit Retail product |
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
/* | |
XBeeSerialEcho -- Simple sketch for demonstrating two-way XBee communication | |
Requires: | |
(These items are found in the SparkFun XBee Wireless Kit Retail product | |
or can be obtained individually.) | |
* 1 x SparkFun XBee Explorer USB |
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
When building a new instance of Amazon EC2 choose quick-start-1 as the security group not default | |
#LOCALLY | |
$ capify . | |
$ chmod +x config/unicorn_init.sh | |
$ git add . | |
$ git commit -m "deployment configs" | |
If rebuilding an instance don't forget to remove the ssh keys |