Skip to content

Instantly share code, notes, and snippets.

jackyshan

Block or report user

Report or block jackyshan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jackyshan
jackyshan / iosicon.sh
Last active Jan 12, 2018
iOS图标规格切图
View iosicon.sh
#!/bin/sh
convert icon-1024.png -resize 180x180 icon-180.png
convert icon-1024.png -resize 152x152 icon-152.png
convert icon-1024.png -resize 120x120 icon-120.png
convert icon-1024.png -resize 87x87 icon-87.png
convert icon-1024.png -resize 80x80 icon-80.png
convert icon-1024.png -resize 76x76 icon-76.png
convert icon-1024.png -resize 58x58 icon-58.png
convert icon-1024.png -resize 40x40 icon-40.png
convert icon-1024.png -resize 29x29 icon-29.png
View http_proxy.sh
给 iTerm 终端设置代理
1.设置代理
使用 curl,wget,brew等http应用程序会调用http_proxy和https_proxy这两环境变量进行代理,通过下面方式设置:
export http_proxy=http://127.0.0.1:8087
export https_proxy=$http_proxy
2.取消设置
unset http_proxy https_proxy
@jackyshan
jackyshan / checkss_city.py
Created Jul 11, 2017
检查ss客户端地址在哪个城市
View checkss_city.py
# -*- coding: utf-8 -*-
import re, urllib2, json, time
import sys
reload(sys)
sys.setdefaultencoding('utf8')
file = open('server.log')
list = file.readlines()
file.close()
@jackyshan
jackyshan / checkss.py
Created Jul 6, 2017
检查ss客户端ip地址
View checkss.py
# -*- coding: utf-8 -*-
import re
file = open('shadowsocks.log')
list = file.readlines()
file.close()
pattern = re.compile(r'INFO.+(\d+\.){3}\d+')
@jackyshan
jackyshan / mailsend.py
Created Jul 5, 2017
邮件发送Python集成
View mailsend.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from email import encoders
from email.header import Header
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
import smtplib
@jackyshan
jackyshan / DBBaseObject.swift
Last active May 29, 2017
realm基础数据封装代码,实现增删查改
View DBBaseObject.swift
//
// DBBaseObject.swift
// DianZiCheng
//
// Created by jackyshan on 2017/5/28.
// Copyright © 2017年 jackyshan. All rights reserved.
//
import UIKit
@jackyshan
jackyshan / swift_setter_getter.swift
Created May 18, 2017
swift实现setter和getter的方法
View swift_setter_getter.swift
private var key: Void?
extension MAPolyline {
var isWalk: Bool? {
get {
return objc_getAssociatedObject(self, &key) as? Bool
}
set {
objc_setAssociatedObject(self,
&key, newValue,
View rxswift_timer_interval.swift
let interval = Observable<Int>.interval(0.6, scheduler: MainScheduler.instance)
let disinterval = interval.subscribe(onNext: { (time) in
guard time < lines.count else {
return
}
self.searchBusLine(lineId: lines[time].gid)
})
let timeE:DispatchTime = DispatchTime.now() + Double(lines.count*Int(NSEC_PER_SEC)) / Double(NSEC_PER_SEC);
DispatchQueue.main.asyncAfter(deadline: timeE) {
@jackyshan
jackyshan / rxswift_netsequence_list.swift
Created May 15, 2017
rxswift网络序列顺序请求
View rxswift_netsequence_list.swift
enum TestError: Error {
case errorcatch
}
var count = 1
let symbol1 = Observable<String>.create { (observer) -> Disposable in
observer.onNext("symbol1--------test")
You can’t perform that action at this time.