Skip to content

Instantly share code, notes, and snippets.

View halfer's full-sized avatar

Jon halfer

  • Birmingham, England
View GitHub Profile
FROM alpine:3.8
# Do a system update
RUN apk update
# Add Apache
RUN apk add --update apache2
# Create working folder
RUN mkdir /run/apache2
@halfer
halfer / gist:6ed319383757d90fbc7b53c24e752df2
Created January 18, 2019 11:53
Server Automation.xml
<mxfile modified="2019-01-17T23:22:33.434Z" host="www.draw.io" agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0" etag="1dIKtqgFg9MEwHfA1qS_" version="10.1.0" type="device"><diagram id="zG5rbSCtaAB63NkbvFb8" name="Page-1">3ZdNj5swEIZ/DcdKAYOTHJN02+0h0krph9SbCxOwanBkTD766zssJsSYaNM2u4maS/Bre8w847EHjyzy/UfFNtlSJiC8YJTsPfLeCwJ/REP8q5VDo0wC2gip4okZ1Akr/gvamUateAKlNVBLKTTf2GIsiwJibWlMKbmzh62lsFfdsBQcYRUz4arfeKKz1otxpz8CT7N2ZZ9Om56ctYONJ2XGErk7kciDRxZKSt085fsFiBpey6WZ9+FM7/HFFBT6kgmb71yS+ClaBZMqmj1uv6zJ8l3QWNkyURmHzcvqQ0tAyapIoDYy8sh8l3ENqw2L694dxhy1TOcCWz4+GnOgNOzPvqd/9B63DcgctDrgEDMhNLwOdnPX0Q8jo2Un5IOJEZmJeHq03EHBB8PlDxiRu2dEqAuJ0jeFRB1Ic/SmzgPQTNwc2NgG5gcuMH88ACwMXwvYxAH2lStdMcFL5IKwQKHHNwd33DH3Q27qkFvIQjNegCpvziuc9lJzeiGvo3h1Xr7vAFuyoqqzcvSj4ngh9qGh+9omU2olf8JCCqlQKWSBI+drLkRPwu2bFtiMERfuXjKvYXK8TmemI+dJUi8zGAo7WFeIBo2sYIwH7pJRNHBMvloo3Pt2VmmJtcJzzv/n0Rjb0YgGUoP6bxqOC652KJJZXUfWGAUrSx4PnRmQOGXki1RO3B4qaFpNgWCab23zQyjMCk+S48LnSgXarwBKWakYzKTT8rFnh05fMKSZSkE7hp4Dc/T6H2IVOrH6/CkH
We take the security of your personal details seriously and promise to keep them safe. We won't ever pass you e-mail address onto anyone else.
@halfer
halfer / gist:cd7475650ec7b952d3c9185bd2203dcd
Created August 24, 2018 21:10
Machine executor output in CircleCI when installing PHP
#!/bin/bash -eo pipefail
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1
Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.
Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa
You can get more information about the packages at https://deb.sury.org
@halfer
halfer / recursive-fetch.php
Last active April 5, 2017 19:39
Script to examine bugs and behaviours in spatie/crawler (for 1.3, shows that I should not be doing my own de-duping!)
<?php
namespace Proximate;
use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions;
use Spatie\Crawler\Crawler;
use Spatie\Crawler\Url;
use Spatie\Crawler\CrawlObserver;
#use Spatie\Crawler\CrawlInternalUrls;
@halfer
halfer / notes.txt
Last active August 29, 2015 14:16
Recommendation algorithm
table "recommendation_action"
id_item (int)
item_type (int - 1 = "users browsed X", 2- "users bought X")
id_user
table "recommendation_pair"
id_item_from (int)
id_item_to (int)
Algorithm:
@halfer
halfer / ns-plan.txt
Last active August 29, 2015 14:15
Suggested plan for nested set prototype
* Create working NS implementation
- The basic algorithm just requires 'left' and 'right' nodes, but it is a good idea to add in a
'parent' node, as this simplifies some of the SQL
- There are plenty of implementations on the web already, check GitHub and do a search
* Add the per-node columns as discussed on Stack Overflow
- 'table_name' for table, 'primary_key' for ID
* Add some data tables
- 'customer', 'address', 'book', etc.
* Write some code to handle a hierarchical string expression
- Convert an expression like `customer.address.postcode` to three levels of hierarchy plus a value