Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lukearmstrong on github.
  • I am lukearmstrong (https://keybase.io/lukearmstrong) on keybase.
  • I have a public key whose fingerprint is 6BD3 B05B D75C 91B8 A513 545F DFC4 BF59 8B7B 8EC2

To claim this, I am signing this object:

@lukearmstrong
lukearmstrong / vagrant.plist
Created January 24, 2014 11:38
Sequel Pro - Configuration to connect to MySQL on Vagrant Box created by PuPHPet.com
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SPConnectionFavorites</key>
<array>
<dict>
<key>database</key>
<string></string>
<key>host</key>
<!-- must define a width/height for this div in css -->
<div id="google-map"></div>
<script src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
function initialize()
{
var latLng = new google.maps.LatLng(52.29538, -1.54200);
var mapOptions = {
@lukearmstrong
lukearmstrong / nginx-vhost-php.conf
Created October 25, 2013 14:18
Example vhost config for Nginx (PHP)
server {
listen 80;
server_name .example.co.uk.dev;
access_log /usr/local/var/log/nginx/example.co.uk-access.log;
error_log /usr/local/var/log/nginx/example.co.uk-error.log error;
root /var/www/example.co.uk/public;
index index.php index.html;
@lukearmstrong
lukearmstrong / format-phone.php
Last active May 2, 2024 12:08
Format UK Phone Number
<?php
/*
$original = '+44 (0)1234 567 890';
$original = '0044 01234 567 890';
$original = '01234 567 890';
$original = '44 1234 567 890';
Result should always be:
'+441234567890
@lukearmstrong
lukearmstrong / gist:5782028
Created June 14, 2013 14:01
Laravel 4 Pagination for a "Many to Many" relationship.
$company = \Company::find($companyId)
->with('users')
->first();
$users = $company->users()->paginate(10);
@lukearmstrong
lukearmstrong / .bash_profile
Created June 11, 2013 10:27
Mac OSX Terminal
# auto completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# coloured terminal
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# list all files
@lukearmstrong
lukearmstrong / 1. files
Last active December 17, 2015 14:49
Trying to optimize all files loaded by app.js to app.min.js
|- public/
| |- js/
| | |- app/
| | | |- interactions.js
| | | |- main.js
| | | |- students.js
| | |- lib/
| | | |- console.log.js
| | | |- jquery-1.9.1.js
| | | |- no-js.js
@lukearmstrong
lukearmstrong / shopify-pagination.liquid.html
Last active December 6, 2023 00:41
Shopify - Show links to all pages in pagination, gets rid of the "..."
<div id="pagination">
<ul>
{% if paginate.previous %}
<li>{{ paginate.previous.title | link_to: paginate.previous.url }}</li>
{% endif %}
{% for i in (1..paginate.pages) %}
{% if paginate.current_page == i %}
<li>{{ i }}</li>
* 9d0cdd7 (origin/v1.0-bugs) Merge pull request #84 from propcom/bugfix-mernu
|\
| * 900be12 (HEAD, origin/bugfix-mernu, bugfix-mernu) fixed menu merning
|/
* 7108920 bugfix-public-check merged into bugs; resolves #83