Skip to content

Instantly share code, notes, and snippets.

View mickadoo's full-sized avatar
💭
Making bugs

Michael Devery mickadoo

💭
Making bugs
  • Ireland
View GitHub Profile
// one to many result
{
  "id": 1,
  "first_name": "john",
  "phones": [
    {
      "id": 1,
      "number": "40939394"
 }
@mickadoo
mickadoo / pairfind.php
Last active June 7, 2017 06:41
Sort a dataset of school IDs and group IDs into pairs of the same group, but where school ID must be different
<?php
$pairs = [];
$dataSet = [];
const SCHOOL_ID_COL = 0;
const GROUP_ID_COL = 1;
// load data
$fileName = __DIR__ . '/matching_problem.csv';
@mickadoo
mickadoo / buildkit-setup.sh
Created May 2, 2017 14:34
install tools required for civihr / buildkit
echo "mysql-server-5.5 mysql-server/root_password password root" | sudo debconf-set-selections
echo "mysql-server-5.5 mysql-server/root_password_again password root" | sudo debconf-set-selections
sudo apt-get update
sudo apt-get install -y \
curl \
vim \
man-db \
mysql-server \
git \
php5 \
@mickadoo
mickadoo / openzen.js
Created January 6, 2017 09:26
Open all zendesk tickets from your inbox in one click. Store as browser bookmark and click on from inbox screen. Not tested with gmail.
javascript:(
function(){
var links = document.getElementsByClassName("bV");
for(var i = 0; i < links.length; i++)
{
var link = (links.item(i));
if (link.text == 'View ticket') {
window.open(link.getAttribute('href'));
} else {
console.log('not expected' + link.text);