Skip to content

Instantly share code, notes, and snippets.

View radutopala's full-sized avatar
🦅
Building in Go @trisoftro #golang

Radu Topala radutopala

🦅
Building in Go @trisoftro #golang
View GitHub Profile
@rkibria
rkibria / gospinningcube.go
Last active May 3, 2023 09:40
Generate a .gif showing a spinning 3d wireframe cube with hidden lines in Golang
package main
import (
"fmt"
"image"
"image/color"
"image/gif"
"math"
"os"
)
package main
import (
"fmt"
"io/ioutil"
"net/http"
"sync"
"time"
"go.uber.org/ratelimit"
@bradfitz
bradfitz / sqlplay.go
Created June 23, 2021 17:23
sqlplay.go
package main
import (
"database/sql"
"flag"
"fmt"
"html"
"io"
"io/ioutil"
"log"
@0187773933
0187773933 / GolangSSHTunnelForwardAndReverse.go
Last active March 30, 2024 09:21
Golang SSH Forward and Reverse Tunnel
package main
import (
"context"
"fmt"
"os"
"os/signal"
"path"
"sync"
"syscall"
@m-radzikowski
m-radzikowski / script-template.sh
Last active July 13, 2024 13:20
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
<script type="module">
export default class RemoteContent extends HTMLElement {
constructor() {
super();
this.parser = new DOMParser();
this.shadow = this.attachShadow({mode: 'open'});
this.append = this.shadow.appendChild.bind(this.shadow);
this.shadow.innerHTML = 'loading…';
}
@izzygld
izzygld / Wysiwyg.vue
Created January 9, 2019 14:06
Adding a “show html” button in Quill (Wysiwyg).
<template>
<div>
<vue-editor v-model="content" ref="editor" :editor-options="toolbarOptions" @text-change="updateValue" useCustomImageHandler @imageAdded="uploadImage"></vue-editor>
</div>
</template>
<script>
import Vue from "vue";
import axios from 'axios'
let VueEditor, Quill;
@thiagozs
thiagozs / gomock.md
Last active July 24, 2024 07:53
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 26, 2024 08:00
set -e, -u, -o, -x pipefail explanation
@airbornelamb
airbornelamb / rexray-minio.md
Last active January 3, 2021 11:58 — forked from harshavardhana/README.md
REX-Ray with Minio

Getting Started

The following commands will install the latest version of REX-Ray to /usr/bin/rexray on Linux systems:

$ sudo apt install s3fs
$ curl -sSL https://dl.bintray.com/rexray/rexray/install | sh -s stable

Depending on the Linux distribution, REX-Ray will be registered as either a SystemD or SystemV service.

Configure

REX-Ray requires a configuration file for storing details used to communicate with storage providers. This can include authentication credentials and driver specific configuration options. After REX-Ray has been installed, copy and paste the contents below to a new file on the host at /etc/rexray/config.yml to configure s3fs storage driver.