Skip to content

Instantly share code, notes, and snippets.

View kitgrose's full-sized avatar

Kit Grose kitgrose

View GitHub Profile
@kitgrose
kitgrose / cloudways-deploy.sh
Created August 19, 2024 06:36
Trigger Cloudways Git Deployment
#!/bin/bash
[email protected]
CLOUDWAYS_API_KEY=xxxxxxxx
CLOUDWAYS_API_URL=https://api.cloudways.com/api/v1
SERVER_ID=123456
APP_ID=987654
GIT_BRANCH=release
# Fetch OAuth Access Token via cURL
@kitgrose
kitgrose / hot-track.html
Created July 18, 2024 04:49
Compute colour hot track for image as per Windows 7 taskbar highlights
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image hot track algorithm</title>
</head>
<body>
<input type="file" id="fileinput" accept="image/*" />
@kitgrose
kitgrose / balanced-columns.php
Created January 9, 2014 06:38
Makes n balanced lists of grouped items in PHP, without breaking up any groups in the initial set and while preserving the order of sets. Useful for taking a grouped set of navigation items and presenting them in columns in a navigation menu.
<?php
/*
Makes n balanced lists of sub-lists, without breaking inside any existing lists.
Expects input in the form:
array(
'Section 1' => array(
'Item',
'Item',
@kitgrose
kitgrose / webkit-bug.html
Created December 11, 2012 08:58
Weird WebKit CSS bug
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
tr > * {
padding: 1em;
}
tr:nth-child(even) td {
background-color: red;
@kitgrose
kitgrose / gist:1745011
Created February 5, 2012 12:01 — forked from xerxesb/gist:1744913
Netbank hackery
var BetterNetbank = {
inject: function(table) {
if ($("#" + table).length > 0) {
$('#' + table + ' thead tr').prepend('<th>X</th>');
$('#' + table + 'Body > tr').map(function() {
$(this).prepend('<td><input type="checkbox" /></td>');
});
}
}
}