Skip to content

Instantly share code, notes, and snippets.

View arunavo4's full-sized avatar
🏠
Working from home

ARUNAVO RAY arunavo4

🏠
Working from home
View GitHub Profile
@jesugmz
jesugmz / multi-cloud-docker-swarm.md
Last active January 2, 2024 18:40
Create a simple multi cloud Docker cluster using Docker Swarm, Docker Machine and the three top cloud providers nowadays - Google Compute Engine, Microsoft Azure and AWS

Simple multi cloud Docker cluster using Docker Swarm

This guide explains how to create a simple multi cloud Docker cluster using Docker Swarm, Docker Machine and the three top cloud providers nowadays - Google Compute Engine, Microsoft Azure and AWS.

Prerequisites

This guide assumes you have a Linux host with Docker CE installed. If you are using Docker for Mac or Docker for Windows you can avoid the Docker Machine set up since it comes included.

Install Docker Machine

@mgarod
mgarod / add_method.py
Last active September 30, 2023 00:13
Dynamically add a method to a class
from functools import wraps # This convenience func preserves name and docstring
class A:
pass
def add_method(cls):
def decorator(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
return func(*args, **kwargs)
@rudolfovich
rudolfovich / csvfile.h
Last active June 13, 2024 08:39
CSV file generator
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
class csvfile;
inline static csvfile& endrow(csvfile& file);
inline static csvfile& flush(csvfile& file);
@JakeWharton
JakeWharton / ForegroundImageView.java
Created July 10, 2014 16:42
An ImageView which supports a foreground drawable.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class ForegroundImageView extends ImageView {
private Drawable foreground;