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
(function (name, definition){
if (typeof define === 'function'){ // AMD
define(definition);
} else if (typeof module !== 'undefined' && module.exports) { // Node.js
module.exports = definition();
} else { // Browser
var theModule = definition(), global = this, old = global[name];
theModule.noConflict = function () {
global[name] = old;
return theModule;
@thalesfsp
thalesfsp / haproxy.cfg
Last active August 29, 2015 14:23 — forked from GABeech/haproxy.cfg
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@thalesfsp
thalesfsp / keybase.md
Created February 9, 2016 18:46
KeyBase Prove

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 / git-check-dirty.sh
Created May 18, 2016 00:33
Git check if repo is dirty
if [[ -n $(git status --porcelain) ]]; then echo "repo is dirty"; fi
-----BEGIN PGP MESSAGE-----
Comment: https://keybase.io/download
Version: Keybase Go 1.0.17 (darwin)
wcFMA2xWdG8xegQ0ARAAEh0xY4SP1m2Ag5D9P9ui9XfQhPPpQS0c1xm8+x2Qyyv6
+SxVy96qHg6p4OA7CDvmDY0p2PGsq0o44YzJZ/iCOGKxbQr827L4cdey1cZbGnAZ
a/Ee4Es70PslDVH72dgu54MSvQ2Z4ikwm6V/RXvwYXmHx6u9zwT1iNCcNNv1cgfD
FD/Csqx3vEEZo361MkZ7h0nMDQF8F7JuUVd94pwxk7/sbArEgBy7SoApQzNS6ZX6
XMOxzxme+KcSehp+GLWlGBmG11bkTEgFxHI5Bi0JFmhCcR0Ms96Gp7PH6prtg+tG
9OeubtGSUsJMJaUa8/F/08C9L3ctFXdtr1QrOZ2z8tRgmEVjOUxYAXlFEJff19Qq
@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.");

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 / 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];
@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 / 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"
)