headless browser
puppeteer vs jsdom vs phantomjs
- jsdom
jsdom 是一个轻量级的 headless browser, 基于原生的 js 实现 不过不能渲染布局, 具体可以参考 https://github.com/jsdom/jsdom/wiki/jsdom-vs.-PhantomJS
- PhantomJS
jsdom 是一个轻量级的 headless browser, 基于原生的 js 实现 不过不能渲染布局, 具体可以参考 https://github.com/jsdom/jsdom/wiki/jsdom-vs.-PhantomJS
class RingBuffer < Array | |
attr_reader :max_size | |
def initialize(max_size, enum = nil) | |
@max_size = max_size | |
enum.each { |e| self << e } if enum | |
end | |
def <<(el) | |
if self.size < @max_size || @max_size.nil? |
root = "/var/www/cake/current" | |
working_directory root | |
pid "#{root}/tmp/pids/unicorn.pid" | |
stderr_path "#{root}/log/unicorn.stderr.log" | |
stdout_path "#{root}/log/unicorn.log" | |
listen "/tmp/unicorn.cake.sock" | |
worker_processes 2 | |
timeout 15 |
```sh | |
#/bin/bash! | |
# sudo apt-get install hostapd | |
# git clone https://github.com/oblique/create_ap.git && cd create_ap | |
# sudo make install | |
iwconfig | |
sudo create_ap wlp3s0 enp4s0f0 francis-ubuntu aaabbbccc123 | |
``` |
@media print { | |
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { | |
float: left; | |
} | |
.col-sm-12 { | |
width: 100%; | |
} | |
.col-sm-11 { | |
width: 91.66666667%; | |
} |
module NumberToChineseAmountInWordsHelper | |
# Formats a +number+ into a chinese amount in words(e.g., 壹万元整). | |
# | |
# === Examples | |
# number_to_capital_zh(10001.00) # => '壹万元整', | |
# number_to_capital_zh(100000.10) # => '壹拾万元壹角整', | |
# number_to_capital_zh(0.1) # => '壹角整', | |
# number_to_capital_zh(1.11) # => '壹元壹角壹分', | |
# number_to_capital_zh(1.01) # => '壹元零壹分', | |
# number_to_capital_zh(0.01) # => '壹分', |
require 'axlsx' | |
Axlsx::Package.new do |package| | |
workbook = package.workbook | |
workbook.add_worksheet do |sheet| | |
wrap = workbook.styles.add_style alignment: {wrap_text: true} | |
sheet.add_row ["Foo\r\nBar", "Foo\rBar", "Foo\nBar", "Foo\n\r\nBar"], style: wrap | |
end | |
package.serialize "linebreak.xlsx" |
set :linked_files, %W{ | |
... config/app.god config/qrsync.json | |
config/application.yml | |
} | |
# you should remove bin from linked_dirs config | |
# https://github.com/capistrano/bundler/issues/45 | |
set :linked_dirs, %w{config/unicorn log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} | |
namespace :deploy do |
Install MySQL Database 5.5.37 on CentOS 6.5/5.10, Red Hat (RHEL) 6.5/5.10
1.change user
su
2.Install Remi repository
chrome://inspect/#devices
localhost:8999
chrome://flags/#enable-devtools-experiments
http://www.html5rocks.com/en/tutorials/developertools/revolutions2013/?redirect_from_locale=zh
adb forward tcp:8999 localabstract:chrome_devtools_remote
http://stackoverflow.com/questions/3877027/jquery-callback-on-image-load-even-when-the-image-is-cached