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 / 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")
@jackyshan
jackyshan / navigationcontrollertransition.m
Created May 8, 2017
navigationcontroller页面翻转
View navigationcontrollertransition.m
override func backBtnAction() {
UIView.transition(with: (self.navigationController?.view)!, duration: 0.7, options: .transitionFlipFromLeft, animations: {
self.navigationController?.popViewController(animated: false)
}, completion: nil)
}
let vc = BusLineMapViewController()
UIView.transition(with: (self.navigationController?.view)!, duration: 0.7, options: .transitionFlipFromRight, animations: {
self.navigationController?.pushViewController(vc, animated: false)
}, completion: nil)
@jackyshan
jackyshan / activity_life.java
Last active May 6, 2017
activity生命周期
View activity_life.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_table);
}
@Override
protected void onStart() {//开启
super.onStart();
}
@jackyshan
jackyshan / RxSwiftUIBindPartical.swift
Created Apr 14, 2017
RxSwift基础UI绑定实战总结
View RxSwiftUIBindPartical.swift
//
// BusDriverFeedbackViewController.swift
// renttravel
//
// Created by jackyshan on 2017/3/8.
// Copyright © 2017年 GCI. All rights reserved.
//
import UIKit
import RxSwift
You can’t perform that action at this time.