One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| #!/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);") |
Пропустить теорию и перейти прямо к задачам
Ссылка на учебник: http://learn.javascript.ru
Сразу расскажу про несколько особенностей яваскрипта, о которых может быть не написано (или мало написано) в учебниках, но которые стоит понимать:
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| #!/bin/bash | |
| # This isn't really a git hook, but it's manually called it after every fetch run. | |
| # This script essentially wraps the actual post-receive hook. | |
| # Build the standard input for the post-receive hook | |
| cat refs/heads/* | paste TRAC_HEAD - > post-fetch.tmp | |
| find refs/heads/* | paste post-fetch.tmp - | awk '{print $1, $2, $3}' > post-fetch.stdin | |
| # Call the post-receive hook just like the commits were pushed |
| var http = require('http'); | |
| http.createServer(function (request, response) { | |
| response.setHeader('Content-Type', 'text/html; charset=UTF-8'); | |
| response.setHeader('Transfer-Encoding', 'chunked'); | |
| var html = | |
| '<!DOCTYPE html>' + | |
| '<html lang="en">' + | |
| '<head>' + |
| #!/bin/sh | |
| # this script was initially written for Redhat/CentOS | |
| # file is /etc/cron.daily/diskAlert.cron | |
| # requires enabling outgoing sendmail from localhost to a valid | |
| # smtp server, which is usually disabled by default | |
| ADMIN="jausten@adomain.com,another@adomain.com" | |
| THRESHOLD=90 | |
| df -PkH | grep -vE '^Filesystem|tmpfs|cdrom|media' | awk '{ print $5 " " $6 }' | while read output; | |
| do |