Skip to content

Instantly share code, notes, and snippets.

View paulcurley's full-sized avatar

Paul paulcurley

View GitHub Profile

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
# Ruby script to grab photos tagged of yourself on facebook and download them.
# Go to the Graph API explorer (http://developers.facebook.com/tools/explorer)
# and generate an access token with the permissions you need (user_photos, user_photo_video_tags)
# and use that access token here.
require 'json'
require 'net/http'
def fetch(output_dir, username, photo_limit, access_token)
@paulcurley
paulcurley / webpack-unused-files.sh
Created December 18, 2018 14:30 — forked from xjamundx/webpack-unused-files.sh
Quickly identify files unused by webpack
# ----------------------------------- #
webpack --display-modules | awk '{print $2}' | grep ^\.\/ > files-processed.txt;
cd public/js/; # assumes all your files are here
find . -name "*.js" | grep -v eslint | grep -v __ > ../../files-all.txt; # excludes __tests__ and .eslintrc files
cd ../..;
cat files-all.txt | xargs -I '{}' sh -c "grep -q '{}' files-processed.txt || echo '{}'";
rm files-processed.txt files-all.txt;
# ----------------------------------- #