Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Rocking the world!

Energy Star thalesfsp

🚀
Rocking the world!
View GitHub Profile
@thalesfsp
thalesfsp / HttpProxy.go
Created Oct 14, 2021 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
View HttpProxy.go
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@thalesfsp
thalesfsp / commands-channel.go
Created Aug 18, 2021 — forked from proudlygeek/commands-channel.go
Golang Commands in Goroutines
View commands-channel.go
package main
import (
"fmt"
"log"
"os/exec"
"runtime"
)
type Worker struct {
@thalesfsp
thalesfsp / sshtunnel.go
Created Apr 26, 2021 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
View sshtunnel.go
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
View FastLED-Slow-Fade.ino
#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 Jun 23, 2020 — forked from kriegsman/TimecodePerformance.ino
Sequence a performance using timecode HH,MM,SS.SSS
View TimecodePerformance.ino
#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 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
View macapp.go
// 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 Nov 14, 2019 — forked from lgarron/copyToClipboard.html
Simple `navigator.clipboard.writeText()` polyfill.
View copyToClipboard.html
<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 Jul 30, 2019 — forked from iamralch/ssh_client.go
SSH client in GO
View ssh_client.go
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@thalesfsp
thalesfsp / main.go
Created Jul 13, 2019 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@thalesfsp
thalesfsp / disconnect-dc.sh
Created Oct 7, 2018 — forked from a-robinson/disconnect-dc.sh
Docker compose file for 3-datacenter cockroachdb cluster with 2 nodes in each datacenter
View disconnect-dc.sh
docker network disconnect "${PWD##*/}_shared" roach-4
docker network disconnect "${PWD##*/}_shared" roach-5