Skip to content

Instantly share code, notes, and snippets.

View RuairiSpain's full-sized avatar
🏠
Working from home

Ruairi O'Donnell RuairiSpain

🏠
Working from home
View GitHub Profile
@RuairiSpain
RuairiSpain / cloudSettings
Created October 22, 2016 19:10
Visual Studio Code Sync Settings GIST
{"lastUpload":"2016-10-22T19:09:40.353Z"}
@RuairiSpain
RuairiSpain / jog.js
Last active October 27, 2016 10:08
monkey patch JS Console for logging
function jog(obj, level = 0, cb) {
let handler = {
get(target, propKey, receiver) {
const method = target[propKey];
const levels = ['', 'log', 'debug', 'info', 'warn', 'error'];
var models = {
'user': User,
'todo': Todo
};
server.get( '/:model', function(req, res, next) {
models[req.params.model]
.findAll({}) // .findAll({ include: [ req.body.include ] })
.then(results => { res.send(200, results);}) /// need HTTP status codes
.catch(err { res.send(400, results);});
version: "3"
services:
redis:
image: redis:3.2-alpine
ports:
- "6379"
networks:
- voteapp
import { actions as ticketActions } from 'ducks/ticket'
import { actions as messageActions } from 'ducks/message'
import { actions as navigationActions } from 'ducks/navigation'
...
const mapDispatchToProps = (dispatch) => ({
...bindActionCreators({
...ticketActions,
...messageActions,
@RuairiSpain
RuairiSpain / assertions-compareScreenshot.js
Created November 1, 2017 20:30 — forked from richard-flosi/assertions-compareScreenshot.js
Nightwatch with Visual Regression testing
// assertions/compareScreenshot.js
var resemble = require('resemble'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
@RuairiSpain
RuairiSpain / assertions-compareScreenshot.js
Created November 1, 2017 20:30 — forked from richard-flosi/assertions-compareScreenshot.js
Nightwatch with Visual Regression testing
// assertions/compareScreenshot.js
var resemble = require('resemble'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
@RuairiSpain
RuairiSpain / App.js
Created August 29, 2021 14:06 — forked from aweary/App.js
import React from "react";
import useMutableReducer from "./useMutableReducer";
const reducer = (draft, action, state) => {
switch (action) {
case "increment":
draft.count++;
break;
case "decrement":
draft.count--;

Keybase proof

I hereby claim:

  • I am ruairispain on github.
  • I am ruairiadidas (https://keybase.io/ruairiadidas) on keybase.
  • I have a public key ASDL1fnC93HKMF0fLY3AGQgoB8i5IFptjvU3CLk7VY-4BQo

To claim this, I am signing this object:

@RuairiSpain
RuairiSpain / Makefile
Created April 9, 2023 00:16 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)