Skip to content

Instantly share code, notes, and snippets.

View Tom-Millard's full-sized avatar
🏠
Working from home

Tom Millard Tom-Millard

🏠
Working from home
View GitHub Profile
# Autodetect text files
* text=auto
# Force the following filetypes to have unix eols, so Windows does not break them
*.* text eol=lf
# Encrypt the repository
# Remove/modify this line if the repository is meant to be open-source
*.* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
# These files are text and should be normalized (Convert crlf => lf)
*.php text
@Tom-Millard
Tom-Millard / lazy-fonts.js
Created February 1, 2018 17:47
Lazy load google fonts
(function(d){
var x = d.createElement("link");
var y = d.getElementsByTagName("script")[0];
x.rel = "stylesheet";
x.href = "https://fonts.googleapis.com/css?family=Raleway:400,900";
y.parentNode.insertBefore(x, y);
})(document);
@Tom-Millard
Tom-Millard / App
Last active May 25, 2017 12:27
Some js code for routing
import App from './components/App';
import Router from './components/Router';
import { h, render, Component } from 'preact';
App.router = new Router();
App.main = document.getElementById('main');
App.router.registerRoute("/releases/[from]/[to]", {args : 3, action : () => {
import('./components/List').then(mod => {
import { h, render, Component } from 'preact';
import './scss/main.scss';
export class List extends Component {
constructor(props){
super(props);
this.state = { data : [] };
this.loc = window.location.pathname;
console.log("loaded");
}
#!/bin/bash
brew update;
brew unlink php53 php54 php55 php56;
brew tap homebrew/dupes;
brew tap homebrew/versions;
brew tap homebrew/homebrew-php;
brew install php70;
brew install composer;
#!/bin/bash
sudo yum -y update;
sudo yum -y install ruby;
sudo yum -y install wget;
cd /home/ec2-user;
wget https://aws-codedeploy-eu-west-2.s3.amazonaws.com/latest/install;
chmod +x ./install;
sudo ./install auto;
@Tom-Millard
Tom-Millard / sing.sh
Last active November 30, 2016 15:09
A shell script to get your mac to sing - 'The Chain, by Fleetwood Mac'
#!/bin/bash
say "Listen to the wind blow, watch the sun rise
Run in the shadows, damn your love, damn your lies
And if, you don't love me now
You will never love me again
I can still hear you saying
You would never break the chain (Never break the chain)
And if, you don't love me now
@Tom-Millard
Tom-Millard / node.pp
Created September 29, 2016 09:09
Install node on CentOS 7 with puppet
#BEGIN - Install node.js
package { 'gcc-c++':
ensure => 'installed',
}
package { 'make':
ensure => 'installed',
}
exec { 'setup-node':
// Ver: 5.2.50610
if (typeof(st_js) == "undefined") {
stDRTL = 0;
stAHCM = 0; // 0
stAHWS = 1; // 1
stSMSC = 1; // 1
stSCSP = 0; // 0
stCFSP = 0; // 0
stBIMG = 1; // 1
stILOC = 0; // 0
@Tom-Millard
Tom-Millard / tools.sass
Created September 2, 2015 10:22
sass width tools
//widths for things
@for $i from 1 through 10 {
.w--#{ ($i * 10) } { width : #{ ($i * 10) }% }
}