Skip to content

Instantly share code, notes, and snippets.

View gaving's full-sized avatar
🎯
Focusing

Gavin Gilmour gaving

🎯
Focusing
View GitHub Profile
@ijokarumawak
ijokarumawak / 0.flow.png
Last active February 15, 2022 11:05
NiFi example flow which limits number of incoming FlowFiles by Wait and Notify.
0.flow.png
@ijokarumawak
ijokarumawak / 0.NIFI_Example_CSV_JOIN.md
Last active January 15, 2024 02:31
NiFi example on how to join CSV files to create a merged result.

NiFi example on how to join CSV files to create a merged result

Let's say there're following 3 CSV files (a, b and c):

t, v
1, 10
2, 20
3, 30
4, 40
@croxton
croxton / SSL-certs-OSX.md
Last active June 3, 2025 17:42 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@ipedrazas
ipedrazas / dump
Created April 22, 2017 04:10
Mongo dump/restore with docker
# Backup DB
docker run \
--rm \
--link running_mongo:mongo \
-v /data/mongo/backup:/backup \
mongo \
bash -c ‘mongodump --out /backup --host $MONGO_PORT_27017_TCP_ADDR’
# Download the dump
scp -r USER@REMOTE:/data/mongo/backup ./backup
@felixebert
felixebert / large-json-import.cypher
Created April 10, 2017 14:36
Import of large JSON file into neo4j using apoc
CALL apoc.periodic.iterate("
CALL apoc.load.json('file:///Users/f/source/companies.json')
YIELD value UNWIND value.rows AS row RETURN row
", "
MERGE (c:Company {id: row.id})
ON CREATE SET c.id = row.id, c.name = row.name
WITH row
UNWIND row.relatedPersons as item
MERGE (p:Person {id: item.person.id})
ON CREATE SET p.id = item.person.id, p.name = item.person.name
@rcmorano
rcmorano / docker-registry-expect-scripted-login
Created March 29, 2017 09:52
expect script to interact with "docker login"
#!/bin/bash
#DOCKER_REGISTRY_URI=_DOCKER_REGISTRY_URI_
#DOCKER_REGISTRY_USER=_DOCKER_REGISTRY_USER_
#DOCKER_REGISTRY_PASS=_DOCKER_REGISTRY_PASS_
expect <<EOF
spawn docker login -u $DOCKER_REGISTRY_USER $DOCKER_REGISTRY_URI
while (1) {
expect {
@peterdemartini
peterdemartini / command.sh
Last active July 31, 2025 03:32
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@krstffr
krstffr / debounced-redux-thunk-action.js
Created December 16, 2016 12:04
Debouncing redux thunk actions.
// A common redux pattern when dealing with async functions is to use thunk.
// This usually means your action returns a new function instead of an action object,
// and the thunk middleware will make it all work. Example:
const asyncAction = () => dispatch => setTimeout(() => dispatch(someOtherAction()), 10000);
// Now: maybe that async stuff going on is calling some API which you don't want to overload
// with request, and that's what debounce is for.
// This is an example of a debounced function which will only be calleable once every second.
import { debounce } from 'lodash';
const debouncedFn = debounce(() => callApi(), 1000, { leading: true, trailing: false });
@roblogic
roblogic / msys2-setup.md
Last active March 5, 2025 01:29
MSYS2 first time setup