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 / 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
@thalesfsp
thalesfsp / git-tag-delete-local-and-remote.sh
Created April 29, 2018 19:44 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@thalesfsp
thalesfsp / git-submodule-fetch
Created April 29, 2018 19:44 — forked from ianhinder/git-submodule-fetch
Parallel submodule fetch
#!/bin/bash
set -e
set -u
if [ $# -eq 0 ]; then
git submodule -q foreach 'echo $name' | xargs -n 1 -P 10 git-submodule-fetch
else
while [ $# -gt 0 ]; do
(cd $1; git fetch -q || echo "Failed to fetch $1">&2)
@thalesfsp
thalesfsp / curl.md
Created August 31, 2017 22:40 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.