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 / FlinkSink-NightlyJSONExport.java
Created November 24, 2024 23:22
Flink job to batch process a Iceberg table CDC to export both a single .tar.gz and a chunked .tar gz. Parameterize all the settings
import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.core.fs.Path;
import org.apache.flink.table.api.*;
import org.apache.flink.table.api.bridge.java.BatchTableEnvironment;
import org.apache.flink.connector.file.sink.FileSink;
import org.apache.flink.api.common.serialization.BulkWriter;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
@RuairiSpain
RuairiSpain / Regex_madness.py
Last active August 19, 2024 13:50
Regex tokenizer in python and split to make it debug friendly
import re
# Define constants for constraints used in the regex
MAX_HEADING_LENGTH = 7
MAX_HEADING_CONTENT_LENGTH = 200
MAX_HEADING_UNDERLINE_LENGTH = 200
MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100
MAX_AUTHOR_NAME_LENGTH = 100
MAX_INLINE_CODE_LENGTH =500
MAX_LIST_ITEM_LENGTH = 200
MAX_NESTED_LIST_ITEMS = 6
@RuairiSpain
RuairiSpain / arbitrator.go
Created April 2, 2024 17:55
Go Lock Arbitrator
package arbitrator
import (
"sync"
)
// LockArbitrator manages multiple locks and their waitlists.
type LockArbitrator struct {
locks map[string]*lockState
mu sync.RWMutex // Use RWMutex for read/write locking.
@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)

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 / 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--;
@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;
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,
version: "3"
services:
redis:
image: redis:3.2-alpine
ports:
- "6379"
networks:
- voteapp