Skip to content

Instantly share code, notes, and snippets.

- (NSString *)hashForObject:(NSObject*)object {
// Archive data
NSData *d = [NSKeyedArchiver archivedDataWithRootObject: object];
// Create MD5
unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];
CC_MD5(d.bytes, d.length, md5Buffer);
NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
[output appendFormat:@"%02x",md5Buffer[i]];
+ (NSString *)hashForObject:(id)object usingMethod:(AJCHasherMethod)method {
//object = [object copy];
CC_MD5_CTX context;
CC_MD5_Init(&context);
if ([object respondsToSelector:@selector(countByEnumeratingWithState:objects:count:)]) {
if([object isKindOfClass:[NSDictionary class]]) {
// It's an NSDictionary, need to hash the keys and values seperately, combine them, then reorder them into an array.
NSMutableArray *newArray = [NSMutableArray new];
#define CT_SHARED_INSTANCE_USING_BLOCK(block) \
static dispatch_once_t pred = 0; \
__strong static id _sharedObject = nil; \
dispatch_once(&pred, ^{ \
_sharedObject = block(); \
}); \
return _sharedObject;
+ (SharedThing *)sharedInstance {
var ToolbarSearch = React.createClass({
render : function() {
return (
<form className="navbar-form navbar-center-pos" role="search">
<div className="input-group" id="search-input">
<span className="input-group-addon " id="basic-addon1"><i className="glyphicon glyphicon-search"></i></span>
<input type="text" id="search-control" className="form-control" placeholder="Search" value={this.props.searchText} onChange={this.handleChange} reff="searchTextInput"/>
</div>
</form>
);
var data = { 'groups' :
[
{"id":2,"name":"Members","logo":null,"users":[],"invites":[]},
{"id":3,"name":"Admins","logo":"/system/groups/logo_images/000/000/003/thumb/square-logo.png?1425880825","users":[],"invites":[]},
{"id":4,"name":"PR","logo":null,"users":[],"invites":[]},
{"id":5,"name":"test","logo":null,"users":[],"invites":[]},
Bugs:
- Scroll all the way to the bottom of the screen, then all the way to the right, and then quickly scroll up. Seems to break the 'Featured' row (it disappears) and also causes the free button to continually grow as you press down.
- On the home screen, when holding the remote button down on a workout the calories label turns black.
- Sometimes when scrolling quickly I'll see thumbs duplicated / cells with the wrong thumbnail.
- The thumbnails for 'rest' exercises are sometimes showing a black '2s' and sometimes the updated label of exercise.
- When logged in with a profile that has a thumbnail, it's not showing any placeholder for the thumbnail while it's loading revealling the background.
Observations / Thoughts:
- For some reason appears as those there are very few LCR's coming through. About 70% of the plans & collections , and none that I can find of the workouts.
- Without having logged in / created an account, I subscribed to Premium. I then logged in so I could start a plan. Coming back after sig
Floaters:
- Add size variation to background floaters. They’re probably small enough, so just making some slightly larger would be nice.
- The idea with the bluring was to try and create the sense of depth so need to prevent blurred items from overlapping a non blurred item in the foreground.
- Be preferable to transition on the drag like the prototype (but trying to avoid clipping). If unable can't do it on the drag for technical reasons, then maybe just have the fade not affect the background, and just the content, to avoid it dimming between the fades.
Cards
- Size of card seems a bit big.
- Card doesn’t seem to be centre aligned (particularly noticeable on the Knockout page).
- Need to show a peak of the next / previous card on the sides.
- Header font, can this be filled with the gradient ?
@djfumberger
djfumberger / gist:822af179f81a66b2b6e9
Last active February 28, 2016 23:28
Emoji Face Spec
Face Movement (Container around all face elements apart from heat)
- Three States Types
- Sad (Looks up and down)
Animation
First Part (Time 1.0, Curve: Ease Out)
y = 9
Second Part (Time 1.5, Curve: Ease Out)
y = 0
x = 0
Repeat
Walking Screen
- Change status bar to white. Transition it black when we show the details screen.
- Margins for close and music button probably weren’t quite right from the mockup. Change to 20px either side.
- Missing KM label on the marker once journey has started.
- Change pin markers to be the ones from the zeppelin (rather than the solid white)
- Should be able to pause even in the Ready State (so we can finish)
- Ready state
- Can we just show "00:00 Elapsed Time" instead of ‘Ready’
- Show the text + single pin marker + “Start walking to begin” label in the top map.
- Don’t display the map underneath until we’ve started walking (instead of showing Australia) that or the current location entered.
chatData = [
{ moveToY: 915 },
#{ moveToY: 350 },
{ user: [ { answer: "Hello", shimmer: true, onAnswer: (=> saidHello()) } ], delay: 1.0 },
#{ moveToY: 925 },
{ trainer: "Hi there, I'm Zara. 👀", replyDelay: 1.5},
# { function: (=> unblurBackground()) },
{ scrollBy: 310, time: 1.65, function: (=> unblurBackground()), delay: 0.75 },
{ trainer: "I'm here to help you be more active."},