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 / 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.

@thalesfsp
thalesfsp / intel-edison.md
Created July 4, 2017 06:59
Working with Intel Edison

Updating firmware

First download the firmware in the Intel website.

Then open the mounted disk and remove everything inside. Unzip the content of the download in the drive then access the Edison true screen (see the tutorial bellow).

And run the command:

$ reboot ota
@thalesfsp
thalesfsp / .bash_aliases
Created July 4, 2017 04:56 — forked from WoodyWoodsta/.bash_aliases
What I have done to set the Intel Edison up
### Directory
alias ll="ls -lv"
alias lla="ls -alv"
alias glg="git log --pretty='format:%Cgreen%h%Creset %an - %s' --graph"
alias gl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen %cr %an%Creset'"
alias gs="git status"
alias gd="git diff"
# add
alias ga="git add"
@thalesfsp
thalesfsp / graceful.go
Created June 5, 2017 17:37 — forked from peterhellberg/graceful.go
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@thalesfsp
thalesfsp / gist:f4b3361547f82e1d45128b3eadab746d
Created February 22, 2017 22:08 — forked from timoxley/gist:1721593
Recursively run all tests in test directory using mocha
// this will find all files ending with _test.js and run them with Mocha. Put this in your package.json
"scripts": {
"test": "find ./tests -name '*_test.js' | xargs mocha -R spec"
},
@thalesfsp
thalesfsp / destructuring.js
Created February 9, 2017 05:41 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];

Keybase proof

I hereby claim:

  • I am thalesfsp on github.
  • I am thalesfsp (https://keybase.io/thalesfsp) on keybase.
  • I have a public key ASDLpegz1Ctewu21YTBTHdTuJZvqnQ08NfUoohil7RhRVAo

To claim this, I am signing this object:

@thalesfsp
thalesfsp / es6-abstract-class-example.js
Created October 9, 2016 07:15 — forked from Zodiase/es6-abstract-class-example.js
ES6 Abstract Class Example
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");