This file contains 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/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 |
This file contains 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
给 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 |
This file contains 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
# -*- coding: utf-8 -*- | |
import re, urllib2, json, time | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
file = open('server.log') | |
list = file.readlines() | |
file.close() |
This file contains 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
# -*- coding: utf-8 -*- | |
import re | |
file = open('shadowsocks.log') | |
list = file.readlines() | |
file.close() | |
pattern = re.compile(r'INFO.+(\d+\.){3}\d+') |
This file contains 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/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 |
This file contains 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
// | |
// DBBaseObject.swift | |
// DianZiCheng | |
// | |
// Created by jackyshan on 2017/5/28. | |
// Copyright © 2017年 jackyshan. All rights reserved. | |
// | |
import UIKit |
This file contains 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
// MARK: - <#name#> |
This file contains 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
private var key: Void? | |
extension MAPolyline { | |
var isWalk: Bool? { | |
get { | |
return objc_getAssociatedObject(self, &key) as? Bool | |
} | |
set { | |
objc_setAssociatedObject(self, | |
&key, newValue, |
This file contains 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
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) { |
This file contains 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
enum TestError: Error { | |
case errorcatch | |
} | |
var count = 1 | |
let symbol1 = Observable<String>.create { (observer) -> Disposable in | |
observer.onNext("symbol1--------test") | |