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
@Tom-Millard
Tom-Millard / emailInjection
Last active August 29, 2015 14:23
Email Injection Script JS
function EmailInjection(){
var t = this;
t.inject = function(className, href){
var h = href.join("")
, e = document.getElementsByClassName(className)
;
for(var x = 0, xl = e.length; x<xl; ++x){
e[x].href = "mailTo:" + h;
@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) }% }
}
// 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 / 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':
@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
#!/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;
#!/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;
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");
}
@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 => {
@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);