Skip to content

Instantly share code, notes, and snippets.

View arkilis's full-sized avatar
🎯
Focusing

Ben arkilis

🎯
Focusing
View GitHub Profile
@arkilis
arkilis / TestingAndroidProject_.idea_.name
Created August 14, 2013 00:02
Android Test workspace
TestingAndroid
@arkilis
arkilis / UIAutoLayout.m
Last active November 19, 2015 21:09
iOS Layout
//
// ViewController.m
// testLayout
//
// Created by Ben Liu on 19/11/2015.
// Copyright (c) 2015 Ben Liu. All rights reserved.
//
#import "ViewController.h"
class Solution(object):
def isHappy(self, n):
"""
:type n: int
:rtype: bool
Be careful, this is NOT correct code, teaching purpose only
"""
def rec_happy(n):
class Solution(object):
def isHappy(self, n):
"""
:type n: int
:rtype: bool
"""
def rec_happy(n, ary_temp):
sz= str(n)
sum= 0
class Solution(object):
def isHappy(self, n):
"""
:type n: int
:rtype: bool
"""
ary_temp= []
def rec_happy(n):
sz= str(n)
sum= 0
@arkilis
arkilis / afnetworking3.m
Last active March 18, 2020 13:46
Afnetworking 3 example and usage
// GET
NSURL *URL = [NSURL URLWithString:@"http://example.com/resources/123.json"];
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:URL.absoluteString
parameters:nil
progress:nil
success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
}
failure:^(NSURLSessionTask *operation, NSError *error) {
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *sv= self.view;
UIView *view1= [[UIView alloc] init];
[sv addSubview:view1];
view1.backgroundColor= [UIColor colorWithRed:0 green:0 blue:0 alpha:1.0];
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.mas_topLayoutGuide);
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *sv= self.view;
UIView *view1= [[UIView alloc] init];
[sv addSubview:view1];
view1.backgroundColor= [UIColor colorWithRed:0 green:0 blue:0 alpha:1.0];
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(sv);
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *sv= self.view;
UIView *view1= [[UIView alloc] init];
[sv addSubview:view1];
view1.backgroundColor= [UIColor colorWithRed:0 green:0 blue:0 alpha:1.0];
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(@([[UIApplication sharedApplication] statusBarFrame].size.height));
@arkilis
arkilis / lc238_solution1
Created March 30, 2016 23:32
lc238_solution1
class Solution(object):
# Solution 1
# not passing the performance requirements
def productExceptSelf1(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
aryRes = []
import copy