Skip to content

Instantly share code, notes, and snippets.

View Kevinwlee's full-sized avatar

Kevin Lee Kevinwlee

View GitHub Profile
require 'rubygems'
require 'chargify_api_ares'
require 'cgi'
Chargify.configure do |c|
c.subdomain = 'acme'
c.api_key = 'x'
end
#define YOUR_MODEL_SAVED @"YOUR_MODEL_SAVED_NOTIFICATION"
@Kevinwlee
Kevinwlee / PhoneGap Android Gotcha #1
Created March 31, 2011 03:27
PhoneGap Android Gotcha #1 - no leading underscores
<!-- BAD -->
<script>
$("#main").load("_partial.html");
</script>
<!-- GOOD -->
<script>
$("#main").load("partial.html");
</script>
@Kevinwlee
Kevinwlee / PhoneGap Android Gotcha #2
Created March 31, 2011 03:32
PhoneGap Android Gotcha #2 - done add query params to your src paths
<!-- BAD -->
<link rel="stylesheet" href="css/screen.css?v1.0">
<!-- GOOD -->
<link rel="stylesheet" href="css/screen.css">
@Kevinwlee
Kevinwlee / Paths
Created April 8, 2011 12:26
For the playbook simulator
The .Bar file is here:
/Blackberry/Apps
The bbwp is her:
/Blackberry/bbwp
The deploy tool is here:
/BackBerry/bbwp/blackberry-tablet-sdk/bin
@Kevinwlee
Kevinwlee / site.css
Created May 25, 2011 02:48
geekmeld css rework
body {background: #ffffff; padding: 0; margin: 0; font-size: 14px;}
body * {margin: 0; padding: 0; font-family: "Lucida Grande", helvetica, sans-serif;}
.mainbox{
border-style:solid;
border-width:2px;
width:900px;
-moz-border-radius: 15px 15px 0px 0px;
border-radius: 15px 15px 0px 0px;;
margin:auto;
@Kevinwlee
Kevinwlee / AQTestController.h
Created November 15, 2011 03:25
KIF Framework Before
#import <Foundation/Foundation.h>
#import "KIFTestController.h"
@interface AQTestController : KIFTestController
@end
@Kevinwlee
Kevinwlee / AQTestController.m
Created November 15, 2011 03:31
KIF Framework After
#import "AQTestController.h"
#import "KIFTestScenario.h"
#import "KIFTestScenario+AQAdditions.h"
@implementation AQTestController
- (void)initializeScenarios {
[self addScenario:[KIFTestScenario scenarioToOpenAndCloseTheLogin]];
[self addScenario:[KIFTestScenario scenarioToOpenAndCloseTheCreateActivityScreen]];
[self addScenario:[KIFTestScenario scenarioToEnterTextIntoTheWhereBox]];
@Kevinwlee
Kevinwlee / JSON
Created March 2, 2012 13:48
Getting Date/Time from .NET api
{
"Latitude": 31.550837,
"Longitude": -97.116265,
"Description": "Drop dirties by 1pm in the laundry cart near front desk.",
"Weekday": 3,
"StartTime": "/Date(1329535556148)/",
"EndTime": "/Date(1329535556148)/",
"Dorms": [
"South Russell"
],
@Kevinwlee
Kevinwlee / color for hex
Created March 2, 2012 15:25
UIColor with String Hex
- (UIColor *)colorForHexColor:(id)hexColor{
if (hexColor == [NSNull null]) {
return [UIColor blackColor];
} else {
NSScanner *scanner2 = [NSScanner scannerWithString:hexColor];
unsigned int hex;
[scanner2 scanHexInt:&hex];
return UIColorFromRGB(hex);
}
}