Skip to content

Instantly share code, notes, and snippets.

View rkettelerij's full-sized avatar

Richard Kettelerij rkettelerij

View GitHub Profile
package jmodern;
import com.codahale.metrics.*;
import com.codahale.metrics.annotation.*;
import com.fasterxml.jackson.annotation.*;
import com.google.common.base.Optional;
import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;
import io.dropwizard.Application;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@alexcastillo
alexcastillo / whilePageIsVisible.js
Created August 17, 2020 19:02
RxJS pipe: whilePageIsVisible
import { fromEvent, partition, pipe } from "rxjs";
import { shareReplay, takeUntil, repeatWhen } from "rxjs/operators";
// 🛑 unsubscribes when the browser tab is not active
// ✅ resubscribe when it is becomes active again
export function whilePageIsVisible() {
const visibilityChange$ = fromEvent(document, "visibilitychange").pipe(
shareReplay({ refCount: true, bufferSize: 1 })
);
@hagish
hagish / README
Created May 11, 2014 18:28
running unity unit tests in jenkins
prerequisite
* jenkins on windows
* unity on windows
* YOUR_UNIT_PROJECT contains the unity project in the jenkins workspace
howto
* UNTIY: install Unity Test Tools https://www.assetstore.unity3d.com/#/content/13802
* UNITY: write some unit tests
* JENKINS: add build step "Execute windows batch command" with "run_tests.bat"
* JENKINS: add build set "Publish NUnit test result report" with "unity_unittests_results.xml"
@AlainODea
AlainODea / HelloCovariance.java
Last active November 16, 2022 12:31
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class HelloCovariance {
public static void main(String[] args) {
ConcurrentHashMap<String, String> properties = new ConcurrentHashMap<>();
Set<String> keySet = properties.keySet();
}
}
@spuder
spuder / LICENSE
Last active May 22, 2023 17:10
Script to help recover nomad servers that have lost leadership
Mozilla Public License, version 2.0
1. Definitions
1.1. "Contributor"
means each individual or legal entity that creates, contributes to the
creation of, or owns Covered Software.
1.2. "Contributor Version"
@alexellis
alexellis / arm.md
Last active January 4, 2024 23:17
Test swarm connectivity

Regular PC / cloud architecture (64-bit)

See the snippets "guide.md" and "redis.md" below.

Swarm on a Raspberry Pi

If you're wanting to run Docker Swarm on your Raspberry Pi checkout these instructions:

@sleeyax
sleeyax / go2c.md
Last active February 21, 2024 18:31
CGO <-> C conversions list
Type C Call method Go type Bytes (byte) Numerical range
char C.char byte 1 -128~127
signed char C.schar int8 1 -128~127
unsigned char C.uchar uint8 1 0~255
short int C.short int16 2 -32768~32767
short unsigned int C.ushort uint16 2 0~65535
int C.int int 4 -2147483648~2147483647
unsigned int C.uint uint32 4 0~4294967295
long int C.long int32 or int64 4 -2147483648~2147483647
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results