Skip to content

Instantly share code, notes, and snippets.

@deviantony
deviantony / install-latest-compose.sh
Last active April 20, 2024 22:39
Install latest version of Docker Compose
#!/bin/bash
## THIS IS THE OLD WAY
## Nowadays, simply follow the Compose installation instructions in the official documentation:
## https://docs.docker.com/compose/install/
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
@twasink
twasink / HadoopMain.java
Created February 4, 2014 22:27
Example Hadoop Job that reads a cache file loaded from S3
// Based on http://pragmaticintegrator.wordpress.com/2013/08/16/writing-a-hadoop-mapreduce-task-in-java/
package net.twasink.hadoop;
import java.io.File;
import java.net.URI;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.LongWritable;
@dpiponi
dpiponi / example.cu
Created December 20, 2011 17:36
Minimal CUDA example (with helpful comments).
#include <stdio.h>
//
// Nearly minimal CUDA example.
// Compile with:
//
// nvcc -o example example.cu
//
#define N 1000
@tonious
tonious / hash.c
Last active February 17, 2023 02:25
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#!/bin/sh
#
# Suggested name for this script: git-clean-stale-branches
#
# This script will help to remove "stale" branches from a remote
# repository (by default the "origin" repository). Stale branches
# are any branches that does not exist in the local repository.
#
# This script should be run in the local repository. It will print
# out a git command to remove all branches from the remote repository