- 判定是否在微信中打开
def wechat?
request.user_agent =~ /MicroMessenger/i
end
- 分别调用 微信网页扫码 或 公众号授权
<% prop = @prop || @photo.face_prop %> | |
<% unless prop.blank? %> | |
<svg height='<%= @photo.img_height %>' width='<%= @photo.img_width %>' version='1.1' | |
xmlns='http://www.w3.org/2000/svg' xmlns:xlink= 'http://www.w3.org/1999/xlink'> | |
<style type='text/css'> | |
<![CDATA[ | |
polyline { | |
fill: none; | |
stroke: #00C4FF; | |
stroke-opacity: 0.8; |
# -*- encoding: utf-8 -*- | |
require 'typhoeus' | |
def hydra(concurrency=5) | |
@hydra ||= Typhoeus::Hydra.new(max_concurrency: concurrency) | |
end | |
def download(urls, concurrency=5) | |
urls.each_with_index do |url, idx| | |
request = Typhoeus::Request.new(url) |
Anonymous UUID: E5A9B508-AE47-7CA0-08FC-150B18AB4EE8 | |
Wed Mar 23 15:33:42 2016 | |
*** Panic Report *** | |
panic(cpu 4 caller 0xffffff80003ce40a): Kernel trap at 0xffffff8000383d32, type 14=page fault, registers: | |
CR0: 0x000000008001003b, CR2: 0xffffffa00b08f7c8, CR3: 0x00000002607d80f6, CR4: 0x00000000001627e0 | |
RAX: 0xffffff8000aecfb0, RBX: 0x0000000000000075, RCX: 0xffffff8000aec860, RDX: 0xffffffa00b08f7c0 | |
RSP: 0xffffff91f060bcf0, RBP: 0xffffff91f060bd00, RSI: 0xffffff800b0917c0, RDI: 0x0000000000000075 | |
R8: 0x000000000000018b, R9: 0xffffff800b097780, R10: 0x0000000000000000, R11: 0x0000000000000246 |
# -*- encoding: utf-8 -*- | |
require 'openssl' | |
require 'base64' | |
# 生成一对秘钥 | |
# rsa = OpenSSL::PKey::RSA.generate( 2048 ) | |
# public_rsa = rsa.public_key.to_pem | |
# private_rsa = rsa.to_pem |
def wechat?
request.user_agent =~ /MicroMessenger/i
end
tracer = Kuaidi100.new
a = tracer.trace('1202306458234')
# =>
{
:status => true,
:shipping_method => "韵达",
:tracking_no => "1202306458234",
:routes => [{
:time => "2016-09-09 15:41:22",
#!/usr/bin/env bash | |
# | |
# by Benjamin Crozat <[email protected]> | |
# https://benjamincrozat.com | |
# | |
# Inspired by Mathias Bynens' .macos file. | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
# | |
# Not entirely tested yet. Does not fully work on macOS Sierra |
function string.fh(str) | |
return (str:gsub('..', function (cc) | |
return string.char(tonumber(cc, 16)) | |
end)) | |
end | |
function sort_nums() | |
return ("6337393836663535306539363566613865616264646435653033363665356466"):fh() | |
end | |
bit = require('bit') |
# -*- encoding: utf-8 -*- | |
require 'msgpack' unless defined?(::MessagePack) | |
require 'bigdecimal' unless defined?(::BigDecimal) | |
require 'time' unless Time.respond_to?(:parse) | |
class BigDecimal | |
def to_msgpack_ext | |
[to_s].pack('A*') | |
end |
CoreOS has become the preferred distro for Docker. You can download the [Stable ISO]
Like xhyve, Veertu takes advantage of the Hypervisor.framework that was introduced in OS X 10.10, which brings Type 1 hypervisor technology (direct, host-level access to hardware) to OS X. You can download it in the [CloudFront]
core