Skip to content

Instantly share code, notes, and snippets.

View allenlinli's full-sized avatar
😎

Li Lin allenlinli

😎
View GitHub Profile
#!/usr/bin/env python
# encoding: utf-8
def parse_rules(obj):
assert obj != None
rules = []
stack = []
def _parse(key, item):
@allenlinli
allenlinli / gist:d9a9400fda28809c914c87bfa50575e0
Last active October 12, 2016 23:36
Please read the README in front of this code.
/*
README:
Updated on 13/Oct. I can use self.favoriteList in .m file. Then we can use custom getter here.
1. The implemetation I did for the first time was correct. I used "@property (atomic) NSMutableArray<NSString *> *favoriteList;" in @interface Booking() and it works.
2. I don't need "//@synthesize favoriteList = _favoriteList;" for creating setter and getter, becuase Xcode will create them automaticlly now.
3. I think my implementation is better than having a "@property (atomic) NSMutableArray<NSString *> *favoriteList2;" in .m. Becuase having a favoriteList2 may confuse people. The cons of my implementation is that you may create custom getter and setter so you don't want to use _favoriteList, but for this simple example it should be fine.
*/
//
//
// WatchSessionManager.swift
// WatchConnectivityDemo
//
// Created by Natasha Murashev on 9/3/15.
// Copyright © 2015 NatashaTheRobot. All rights reserved.
//
import WatchConnectivity
static NSInteger const maxRetryCountForFetchingTicket = 10;
- (void)_handleFetchTicketFailWithError:(NSError *)inError petID:(NSString *)inPet
{
if ([inError code] == KKInvalidSessionError) {
//error handling
return;
}
retryCount ++;
@allenlinli
allenlinli / gist:8b2a214d8c8c7f9693f9fc15351187ea
Created October 13, 2017 09:49
here I record three video
Hi [~bevan] [~pia] [~peteru], here I record three video, they are:
Test Case 01 - SignupLoginView
TestCase 02 TSItemView on credit card page
Test Case 03 - signup error
And I wrote test cases that I will put in Confluence to share with whoever needs it.
## Test Cases
- [ ] sign up view
- [ ] **signup successful**
@allenlinli
allenlinli / gist:ea76565d14d6bcbf00c97d2a2a34f54a
Created May 18, 2018 02:57
ECClient init as a signalingDelegate
// ECSingalingChannel.m
- (void)onSocketSignalingMessage:(NSDictionary *)msg type:(NSString *)type {
if (!signalingDelegate) {
signalingDelegate = [_roomDelegate clientDelegateRequiredForSignalingChannel:self];
[signalingDelegate setStreamId:message.streamId];
[signalingDelegate setPeerSocketId:message.peerSocketId];
[self setSignalingDelegate:signalingDelegate];
}
}