This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "### PROVISIONIN PHP 5.2.17..." | |
if [ "$(whoami)" != "root" ] | |
then | |
sudo su -s "$0" | |
exit | |
fi | |
# Add PostgreSQL Apt Repository (provides postgresql-server-dev-9.4) | |
echo "### Installing wget and other dependencies" | |
apt-get install -y wget | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on https://gist.github.com/ManuelTS/935155f423374e950566d05d1448038d | |
set -eo pipefail | |
# This script installs PhantomJS and Wraith along with its dependencies. | |
npm install -g casperjs | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> wraith setup | |
create configs | |
create configs/capture.yaml | |
create configs/history.yaml | |
create configs/spider.yaml | |
create javascript | |
create javascript/cookies_and_headers--casper.js | |
create javascript/cookies_and_headers--phantom.js | |
create javascript/disable_javascript--casper.js | |
create javascript/disable_javascript--phantom.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ###################################################### | |
// This is an example module provided by Wraith. | |
// Feel free to amend for your own requirements. | |
// ###################################################### | |
module.exports = function (phantom, ready) { | |
// make Wraith wait a bit longer before taking the screenshot | |
setTimeout(ready, 10000); // you MUST call the ready() callback for Wraith to continue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ###################################################### | |
// This is an example module provided by Wraith. | |
// Feel free to amend for your own requirements. | |
// ###################################################### | |
module.exports = function (phantom, ready) { | |
// make Wraith wait a bit longer before taking the screenshot | |
setTimeout(ready, 10000); // you MUST call the ready() callback for Wraith to continue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- run: | |
name: Run wraith | |
command: 01-wraith-run | |
- store_artifacts: | |
path: ./wraith/shots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Approach: | |
# 1. Find variable declaration in the form of "$my-var: anyvalue" | |
# 2. Loop through found variables and find occurrences of each variable in all sass files | |
# 3. Filter out vars that occurred only once | |
# Usage: | |
# Create a file (e.g. unused-variables.sh) having the below code, place it outside your sass folder. | |
# Run chmod +x ./unused-variables.sh to give execute permission to your script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Open browser console and add paste the below line. | |
* Outline will be added to all the elements. | |
* | |
* Credit for original idea: https://github.com/saki007ster | |
*/ | |
$$('*').map(A=>A.style.outline=`1px solid hsl(${(A+A).length*9},99%,50%`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @codingStandardsIgnoreStart | |
"use strict"; | |
zoom(); | |
function zoom(classNames, settings) { | |
/** | |
* IE 11 Compatiblity fix. | |
* | |
* IE 11 doesnt support ES6 standard so the function defination line, | |
* function zoom(classNames = {}, settings = {}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
# This script configures wraith and runs wraith. | |
# Fetching Pantheon URL with env:view command. | |
PANTHEON_ENVIRONMENT=$(terminus env:view --print "$TERMINUS_SITE.$TERMINUS_ENV") | |
# Pantheon adds a trailing slash, removing it so it works correctly with sed. | |
PANTHEON_ENVIRONMENT=${PANTHEON_ENVIRONMENT::-1} |
OlderNewer