Skip to content

Instantly share code, notes, and snippets.

View camfindlay's full-sized avatar

Cam Findlay camfindlay

View GitHub Profile

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
@camfindlay
camfindlay / macos_high_sierra_apache_php_brew_2018.md
Created September 18, 2019 04:04 — forked from karlhillx/macos_high_sierra_apache_php_brew_2018.md
macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

Homebrew Installation

First let's install Homebrew.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Lots of stack traces and error messages for CKAN, followed by a comment about how I fixed it (that time).
NB don't email me privately for help - ask on StackOverflow #ckan instead.
David
File "/vagrant/src/ckan/ckan/templates/home/snippets/search.html", line 1, in top-level template code
{% set tags = h.get_facet_items_dict('tags', limit=3) %}
File "/vagrant/src/ckan/ckan/lib/helpers.py", line 949, in get_facet_items_dict
if not c.search_facets or \
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/werkzeug/local.py", line 347, in __getattr__
return getattr(self._get_current_object(), name)
@camfindlay
camfindlay / mailcatcher-install.md
Last active October 31, 2017 19:54 — forked from pitpit/mailcatcher-install.md
Install Mailcatcher on OSX
@camfindlay
camfindlay / Install Composer to use MAMP's PHP.md
Last active August 29, 2015 14:25 — forked from kkirsche/Install Composer to use MAMP's PHP.md
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@camfindlay
camfindlay / mamp_install_composer.bash
Last active August 29, 2015 14:25 — forked from pwenzel/0. mamp_install_composer.bash
Global composer install for MAMP Users on OSX
# Global composer install for MAMP Users on OSX
# http://getcomposer.org/doc/00-intro.md#globally
# For PHP 5.4 Use:
# alias php=/Applications/MAMP/bin/php/php5.4.4/bin/php;
alias php=/Applications/MAMP/bin/php/php5.3.6/bin/php;
curl -sS https://getcomposer.org/installer | php;
mv composer.phar /usr/local/bin/composer;
composer help;
@camfindlay
camfindlay / go.sh
Last active August 29, 2015 14:15 — forked from AshKyd/go.sh
# Fedora-specific PHP environment setup
yum install php php-mbstring php-mysql php-gd
# Manually install composer via https://getcomposer.org/download/
# Install Silverstripe & sqlite driver
composer create-project silverstripe/installer ./ 3.1.10
composer require silverstripe/sqlite3 1.3.*@dev
# Set up router to simulate mod-rewrite
@camfindlay
camfindlay / pr.md
Last active August 29, 2015 14:13 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: