Skip to content

Instantly share code, notes, and snippets.

View paulcurley's full-sized avatar

Paul paulcurley

View GitHub Profile
@paulcurley
paulcurley / install.txt
Created January 12, 2014 12:20
node/ name install for centos5
wget https://raw.github.com/isaacs/nave/master/nave.sh
chmod +x nave.sh
./nave.sh install stable
./nave.sh use stable

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" 
@paulcurley
paulcurley / capfile.rb
Created February 17, 2014 11:58
Symphony CMS - Capistrano recipe
set :application, "example.com"
set :deploy_to, "/var/www/#{application}"
set :repository, "http://github.com/example/example-symphony.git"
set :branch, "master"
set :user, "git"
@paulcurley
paulcurley / reflow.js
Created March 1, 2014 15:47
Simple demo to trigger reflow
var reflow = function () {
var dummy = document.createElement('div');
dummy.style.position = 'absolute';
document.body.appendChild(dummy);
setTimeout(function () {
document.body.removeChild(dummy);
}, 0);
};
@paulcurley
paulcurley / vimrc
Created March 4, 2014 17:17
external vimrc
""""""""""""""""" full vim
set nocompatible " must be the first line
set rtp+=$HOME/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
filetype plugin indent on
Bundle 'kien/ctrlp.vim'
Bundle "MarcWeber/vim-addon-mw-utils"
# 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;
# ----------------------------------- #