Skip to content

Instantly share code, notes, and snippets.

View joantune's full-sized avatar

João Antunes joantune

View GitHub Profile
@jordanluyke
jordanluyke / multimap.ts
Last active June 13, 2023 14:16
TypeScript Multimap
export interface Multimap<K, V> {
clear(): void
containsKey(key: K): boolean
containsValue(value: V): boolean
containsEntry(key: K, value: V): boolean
delete(key: K, value?: V): boolean
entries: MultimapEntry<K, V>[]
get(key: K): V[]
keys(): K[]
put(key: K, value: V): MultimapEntry<K, V>[]
@Pierstoval
Pierstoval / pre-receive.bash
Last active September 9, 2021 07:46
Git pre-receive example to use a bare repo to deploy an ap
#!/bin/bash
########################################################################
################################ README ################################
########################################################################
#
# This script is here to allow the use of "git push prod v1.2.3" commands or similar.
#
# Push a tag to a bare repository having this file as pre-receive hook,
# and you'll be able to deploy directly from command line in your local environment,
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@klausbrunner
klausbrunner / SimpleFuture.java
Created November 19, 2012 11:34
A very simple implementation of the Java Future interface, for passing a single value to some waiting thread. Uses a CountdownLatch to ensure thread safety and provide blocking-with-timeout functionality required by Future. Cancellation isn't supported.
public final class ResultFuture implements Future<Result> {
private final CountDownLatch latch = new CountDownLatch(1);
private Result value;
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return false;
}
@Override