verified和verified_type是微博api返回结果的字段,例如以下api的返回结果
verified_type: -1/200/220/400
#!/bin/bash | |
# | |
# 通过对比 ping 响应时间,找到本机最快的上传ip | |
# Travis@fir.im | |
# | |
# 使用方法: | |
# sh -c "$(curl -sSL https://gist.githubusercontent.com/trawor/5dda140dee86836b8e60/raw/turbo-qiniu.sh)" | |
echo "# 这个脚本理论上可以帮你获取任意域名的最快速的IP" | |
echo "# 获取IP列表的服务由 17ce.com 提供, 非常感谢有这么好的免费服务!" |
func resize(image: NSImage, w: Int, h: Int) -> NSImage { | |
var destSize = NSMakeSize(CGFloat(w), CGFloat(h)) | |
var newImage = NSImage(size: destSize) | |
newImage.lockFocus() | |
image.drawInRect(NSMakeRect(0, 0, destSize.width, destSize.height), fromRect: NSMakeRect(0, 0, image.size.width, image.size.height), operation: NSCompositingOperation.CompositeSourceOver, fraction: CGFloat(1)) | |
newImage.unlockFocus() | |
newImage.size = destSize | |
return NSImage(data: newImage.TIFFRepresentation!)! | |
} |
verified和verified_type是微博api返回结果的字段,例如以下api的返回结果
verified_type: -1/200/220/400
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?