Skip to content

Instantly share code, notes, and snippets.

@caioaao
caioaao / heal_conn.sh
Created November 13, 2017 21:37
Bash script for connection self-healing (to use on my raspberry pi/beaglebone)
#!/usr/bin/env bash
set -euo pipefail
HEARTBEAT_INTERVAL=3
EXPONENTIAL_BACKOFF_POWER=2
EXPONENTIAL_BACKOFF_MAX_TIMEOUT=60
EXPONENTIAL_BACKOFF_INITIAL_TIMEOUT=1
@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@andraskindler
andraskindler / ApiManager.java
Created April 12, 2014 23:23
SwipeRefreshLayout example
package com.andraskindler.sandbox.activity;
import retrofit.RestAdapter;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
public class ApiManager {
@dansimau
dansimau / ping-csv.sh
Created December 23, 2011 11:01
Ping a host and output each reply in CSV format
#!/bin/bash
#
# Do a ping and output results as CSV.
#
# dsimmons@squiz.co.uk
# 2011-12-23
#
if [ $# -lt 1 ]; then
echo "Usage: $0 [--add-timestamp] <ping host>"