Skip to content

Instantly share code, notes, and snippets.

View M1ke's full-sized avatar

Mike Lehan M1ke

View GitHub Profile
@M1ke
M1ke / README.md
Created July 3, 2014 12:00
NatWest Bankline CSV Template

These columns come from the spreadsheet template that can be downloaded from the Natwest website. On that page you can submit fake details to be able to download the zip file. Opening the xlt file in LibreOffice might make some weird macro stuff happen - so better to look at the column titles below!

The table columns are as follows:

  • Your Reference
  • *Debit Account Sort Code
  • *Debit Account Number
  • *Payment Amount
  • *Credit Date
  • *Beneficiary Account Sort Code
@M1ke
M1ke / index.html
Last active August 29, 2015 14:03
Text reader
<html>
<head>
<title>Text Reader</title>
<style type="text/css">
h1 {text-align: center;}
p.text {display: none;}
</style>
</head>
<body>
<h1 class="read">The text will be read here</h1>
@M1ke
M1ke / README.md
Last active August 29, 2015 14:04
FPDI Extension

FPDI Template

This has now been added to the FPDI Extended repository.

@M1ke
M1ke / gulp-bower-multiple.js
Last active August 29, 2015 14:04
A basic but repetitive way of having bower go to multiple directories.
var gulp = require('gulp');
var bower = require('gulp-bower');
gulp.task('bower', function() {
bower({ directory: '../../assets', cwd: './bower/assets/' });
bower({ directory: '../../js', cwd: './bower/js/' });
});
@M1ke
M1ke / gulp-watch.bash
Last active August 29, 2015 14:05
Gnome terminal watch tabs. A quick way to open a new terminal with multiple tabs for watch commands (specifically used in this case because the ruby-sass plugin for gulp is really slow).
#!/bin/bash
gnome-terminal -t "watch" --tab -e "bash -c 'gulp watch'" --tab -e "bash -c 'compass watch'"
@M1ke
M1ke / gulp-beep.js
Created August 11, 2014 16:16
A quick way to get a beep as part of a build process in gulpjs.
function beep(){
var exec = require('child_process').exec;
exec('canberra-gtk-play --file=/usr/share/sounds/gnome/default/alerts/glass.ogg');
}
@M1ke
M1ke / deploy-master
Created September 2, 2014 09:18
After accidentally pushing a development branch out to production (fortunately no problems, just unexpected new features for users) I decided to proactively prevent it happening again with a simple bit of bash and git.
#!/bin/bash
# We only run the deployment if we're already on master; we could do this directly in gulp but it allows for other commands to be added
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ]; then
gulp deploy
else
echo "Must be on master"
@M1ke
M1ke / phpnw12_word-count.js
Created June 24, 2012 13:53
PHPNW12 Talk Submission Word Count
var count=0;
$('#cf_field_4').unbind('keyup').keyup(function(){
var words=($(this).val().split(" ").length);
if (words!=count)
{
$(this).next().html(words+' words');
}
count=words;
});
var count2=0;
@M1ke
M1ke / PhingBuiltTask.php
Created October 6, 2012 00:54
Phing Last Build Time Saver
<?php
/*
* $Id: FileSizeTask.php 1084 2011-05-06 09:55:25Z mrook $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@M1ke
M1ke / post-commit.ps1
Created October 29, 2012 16:17
Shell file for hooks on Windows with mysysgit installed (includes curl if in path) and powershell code for systems without curl.
$liveCommitClient = new-object System.Net.WebClient;
$liveCommitMessage = git show --format='%s' --name-only HEAD
$liveCommitClient.DownloadFile("http://dashboard.hackmanchester.com/commits?git&message="+ $liveCommitMessage + "&user=73&secret=4aYGnJ3gKotIeUztieyV&files=" , "c:\tmp\null");
echo 0