Skip to content

Instantly share code, notes, and snippets.

View thalesfsp's full-sized avatar
🚀
Rocking the world!

Energy Star thalesfsp

🚀
Rocking the world!
  • Global
View GitHub Profile
@thalesfsp
thalesfsp / commands-channel.go
Created August 18, 2021 17:46 — forked from proudlygeek/commands-channel.go
Golang Commands in Goroutines
package main
import (
"fmt"
"log"
"os/exec"
"runtime"
)
type Worker struct {
@thalesfsp
thalesfsp / sshtunnel.go
Created April 26, 2021 21:43 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
#include "FastLED.h"
#define NUM_LEDS 60
#define DATA_PIN 3
CRGB leds[NUM_LEDS];
uint8_t hue = 0;
void setup() {
FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
@thalesfsp
thalesfsp / TimecodePerformance.ino
Created June 23, 2020 17:19 — forked from kriegsman/TimecodePerformance.ino
Sequence a performance using timecode HH,MM,SS.SSS
#include "FastLED.h"
// This sketch shows how to sequence a performance using HH,MM,SS.SSS timecode.
//
// A "ResetPerformance" method is provided so that the performance can be
// restarted from a custom external trigger, e.g., a button or event.
// For demonstration purposes, this Performance is reset if the
// sketch receives a letter "r" on the serial port.
//
// -Mark Kriegsman, January 2015
@thalesfsp
thalesfsp / macapp.go
Created May 13, 2020 20:27 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@thalesfsp
thalesfsp / copyToClipboard.html
Created November 14, 2019 07:38 — forked from lgarron/copyToClipboard.html
Simple `navigator.clipboard.writeText()` polyfill.
<script>
// A minimal polyfill for `navigator.clipboard.writeText()` that works most of the time in most modern browsers.
// Note that:
// - In Edge, this may call `resolve()` even if copying failed.
// - In Safari, this may fail if there is nothing selected on the page.
// See https://github.com/lgarron/clipboard-polyfill for a more robust solution.
// License: public domain
function writeText(str) {
return new Promise(function(resolve, reject) {
var success = false;
@thalesfsp
thalesfsp / ssh_client.go
Created July 30, 2019 19:43 — forked from iamralch/ssh_client.go
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@thalesfsp
thalesfsp / main.go
Created July 13, 2019 07:27 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@thalesfsp
thalesfsp / disconnect-dc.sh
Created October 7, 2018 20:27 — forked from a-robinson/disconnect-dc.sh
Docker compose file for 3-datacenter cockroachdb cluster with 2 nodes in each datacenter
docker network disconnect "${PWD##*/}_shared" roach-4
docker network disconnect "${PWD##*/}_shared" roach-5
@thalesfsp
thalesfsp / golang_job_queue.md
Created August 23, 2018 05:08 — forked from harlow/golang_job_queue.md
Job queues in Golang