(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/usr/bin/env ruby | |
require 'selenium-webdriver' | |
wd = Selenium::WebDriver.for :remote, url: 'http://10.3.1.7:4444/wd/hub', desired_capabilities: :chrome | |
wd.navigate.to 'https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-using-chromedriver-2x/' | |
# Get the actual page dimensions using javascript | |
# | |
width = wd.execute_script("return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);") |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
const fs = require('fs'); | |
const readline = require('readline'); | |
const FILE_PATH = './src/app/assets/css/phillip/styles.css'; | |
const OUTPUT_PATH = './src/app/assets/css/phillip/styles.css'; | |
const NEW_LINE = '\n'; | |
const lineReader = readline.createInterface({ | |
input: fs.createReadStream(FILE_PATH) | |
}); |
const path = require('path'); | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const ROOT = './src/app/assets/css'; | |
const FILE_NAME = 'styles.css'; | |
const EXCLUDES = [ | |
'bloomberg', 'example_dark', 'merrilledge_blue', 'merrilledge_dark', 'merrilledge_light', 'trademonster_dark', 'schwab_dark' | |
]; | |
const NEW_LINE = '\n'; |
const { exec } = require('child_process'); | |
module.exports = function execCmd(cmd, { fromDir = '.' } = {}) { | |
return new Promise((resolve, reject) => { | |
exec(`cd ${fromDir} & ${cmd}`, (error, stdout, stderr) => { | |
if (!error) { | |
resolve(stdout); | |
} else { | |
reject({ error: error, stderr: stderr }); | |
} |
/[a-zA-Z]+(?!.*[a-zA-Z]+)/gi
OS X 10.11, aka El Capitan, comes with a new system font for Chinese users, named PingFang, it includes 6 weights for both Simplified and Traditional Chinese. The same font also appear on iOS 9 as the default UI font, though Apple didn't mention it explicitly.
If you are in Apple Developer Program (costs 99 USD a year), then you can get them now at their developer resource site, otherwise you can wait for their public beta to come out in July or wait for the public release this fall (a free upgrade like previous release).
Or you can get PingFang.ttc
from your developer friends, though you are probably violating its font license one way or another, but I am not a lawyer so freedom to you.
import time | |
import datetime | |
from elasticsearch import Elasticsearch, helpers | |
# the underlying Elasticsearch client | |
es = Elasticsearch(['localhost:9200'], | |
sniff_onz_start=True, | |
sniff_on_connection_fail=True, | |
sniffer_timeout=60) |
const { execSync } = require('child_process'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const SVN_DIR_PATH = path.join(__dirname, '..', 'svn'); | |
if (!fs.existsSync(SVN_DIR_PATH)) { | |
fs.mkdirSync(SVN_DIR_PATH); | |
} |
HTTP provides two ways for servers to control client-side caching of page components:
This breaks down as follows: