This file contains hidden or 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
# /usr/bin/ruby | |
# download_instagram_images.rb | |
require "open-uri" | |
require "json" | |
@uid = "260732811" | |
@access_token = "277504095.59c578a.6aed864be0794247a1c0318221b03d7b" | |
@url = "https://api.instagram.com/v1/users/#{@uid}/media/recent?access_token=#{@access_token}" |
This file contains hidden or 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
EOTEXTERN NSString * const EOTAliyunOSSClientErrorDomain; | |
@interface EOTAliyunOSSClient : NSObject | |
+ (instancetype)sharedClient; | |
- (void)getObjectWithPath:(NSString *)path | |
inBucket:(EOTCloudStorageBucketType)bucket | |
success:(void (^)(NSData *responseData))success | |
failure:(void (^)(NSError *error))failure; |
This file contains hidden or 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
// | |
// VSMedia.h | |
// rugu | |
// | |
// Created by Vincent Sit on 15/1/11. | |
// Copyright (c) 2015年 Vincent Sit. All rights reserved. | |
// | |
#import "VSBaseModel.h" |
This file contains hidden or 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
// | |
// VSMedia.m | |
// rugu | |
// | |
// Created by Vincent Sit on 15/1/11. | |
// Copyright (c) 2015年 Vincent Sit. All rights reserved. | |
// | |
#import "VSMedia.h" |
我个人属于代码洁癖型选手,个人挑一些小毛病,如下:
1、方法名命名不规范,应该为 - (void)getMatchesListWithHolder:(UIView *)holder success:(void(^)(NSArray *dic))success;
,success 是小写。
2、Block 参数变量名不规范。类型是 NSArray,变量名却写 dic
。
3、单例命名不规范,单例通常应该命名为 sharedXXX
,例如 [NSURLSession sharedSession]
。
4、回调只有成功回调,没有失败的回调,如果请求失败了,那么回调就不会被执行。
This file contains hidden or 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
#!/bin/bash | |
# Author : VincentSit | |
# Copyright (c) http://xuexuefeng.com | |
# 批量 ping 云梯 VPN 服务器. | |
# 请将 example.com 替换为你的专属服务器地址. | |
HOSTS=("日本1号:jp1.example.com" | |
"日本2号:jp2.example.com" | |
"日本3号:jp3.example.com" |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from urllib import request | |
import json | |
import os | |
uid = 260732811 | |
access_token = '277504095.59c578a.6aed864be0794247a1c0318221b03d7b' | |
base_url = r'https://api.instagram.com/v1/users/%s/media/recent/?access_token=%s' % (uid, access_token) |
This file contains hidden or 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
uint64_t nanos() { | |
static mach_timebase_info_data_t info; | |
mach_timebase_info(&info); | |
uint64_t now = mach_absolute_time(); | |
now *= info.numer; | |
now /= info.denom; | |
return now; | |
} |
This file contains hidden or 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
#!/bin/bash | |
# update_gfwlist.sh | |
# Author : VincentSit | |
# Copyright (c) http://xuexuefeng.com | |
# | |
# Example usage | |
# | |
# ./whatever-you-name-this.sh | |
# | |
# Task Scheduling (Optional) |
OlderNewer