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
ActiveAdmin.register Doorkeeper::Application do | |
permit_params :name, :redirect_uri | |
# ActiveAdmin will name Rails Engine models with their namespaced names (ex:doorkeeper_application) which | |
# will fail validation and spit back a form with errors where the fields would otherwise be valid. | |
# Setting the model resource name back to 'application'. | |
controller do | |
resources_configuration[:self][:instance_name] = 'application' | |
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
func shakeView(view: UIView, completion:((success: Bool) -> Void)?) { | |
UIView.animateKeyframesWithDuration(0.5, | |
delay: 0, | |
options: UIViewKeyframeAnimationOptions.BeginFromCurrentState, | |
animations: { | |
UIView.addKeyframeWithRelativeStartTime(0, relativeDuration: 1/4, animations: { | |
view.transform = CGAffineTransformMakeTranslation(-5, 0) | |
}) | |
UIView.addKeyframeWithRelativeStartTime(1/4, relativeDuration: 1/4, animations: { | |
view.transform = CGAffineTransformMakeTranslation(5, 0) |
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 UIKit | |
import QuartzCore | |
let crustWidth:CGFloat = 25.0 | |
let pepDiam:CGFloat = 25.0 | |
let pepCount = 20 | |
let pizza = UIView() | |
pizza.bounds = CGRect(x: 0, y: 0, width: 300, height: 300) |
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 your Activities: (Replace "someViewDuration" with an appropriate name for each activity) | |
long appearedAtTime; | |
@Override | |
public void onResume() { | |
super.onResume(); | |
appearedAtTime = System.currentTimeMillis(); | |
} |
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 your ViewControllers: (Replace "someViewDuration" with an appropriate name for each view) | |
NSTimeInterval appearedAtTime; | |
- (void)viewWillAppear:(BOOL)animated { | |
appearedAtTime = [[NSDate date] timeIntervalSince1970]; | |
} | |
- (void)viewWillDisappear:(BOOL)animated { |
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 org.json.JSONArray; | |
#import org.json.JSONException; | |
#import android.content.SharedPreferences; | |
SharedPreferences preferences = getApplicationContext().getSharedPreferences("MyKMPrefs", getApplicationContext().MODE_PRIVATE); | |
if (preferences.getBoolean("TSKMIdentified", false)) {return;} | |
Tapstream tracker = Tapstream.getInstance(); | |
tracker.getConversionData(new ConversionListener() { | |
@Override |
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 <KISSmetricsSDK/KISSmetricsAPI.h> | |
//#import "TSTapstream.h" | |
// Aquire km_identity from TapStream's first-run modification feature and apply as KISSmetrics alias. | |
if (![[NSUserDefaults standardUserDefaults] objectForKey:@"TSKMIdentified"]) { | |
TSTapstream *tracker = [TSTapstream instance]; | |
[tracker getConversionData:^(NSData *jsonInfo) { | |
if (jsonInfo != nil) { | |