Skip to content

Instantly share code, notes, and snippets.

Gustavo Paes gustavopaes

Block or report user

Report or block gustavopaes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View amp-story-issue.html
<!doctype html>
<html amp lang="pt">
<title>UOL Copa do Mundo 2018</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">
<link rel="shortcut icon" href="" type="image/x-icon">
<script src="" async></script>
<script custom-element="amp-ad" src="" async></script>
gustavopaes / atom-update
Created Dec 15, 2017
Atom update to specific version
View atom-update
atom -v
echo "---------"
curl -q -s | grep "name" | awk -F "\"" '{ print $4 }' | head -n 10
echo -n "Update to (ctrl+c to cancel): "
# Constantes indicando ON e OFF do relay
# Hora e minuto que a irrigacao deve ocorrer
gustavopaes / benchmark.js
Created Jan 28, 2017
simple rabbitmq benchmark
View benchmark.js
const amqplib = require('amqplib');
const connect = amqplib.connect('amqp://');
const QUEUE_NAME = 'benchmark';
const TOTAL_MESSAGES = process.argv[2] || 10;
let sendingStartTime;
gustavopaes / handleJsonp.js
Created May 25, 2016
mithril.js feature request: static jsonp callback name
View handleJsonp.js
window.jsonpRequestQueue = {};
function handleJsonp(options) {
var callbackKey = options.callback || ("mithril_callback_" +
new Date().getTime() + "_" +
(Math.round(Math.random() * 1e16)).toString(36))
var script = $document.createElement("script")
// callback já existe, faz fila
if(typeof global[callbackKey] === 'function') {
gustavopaes /
Last active Feb 27, 2016
Shell script to start irrigation using Omega Hardware and Relay Expansion
## Usage example, starts and irrigates for 30 seconds:
## 30
relay-exp -i
force_stop() {
gustavopaes / placeholder-polyfill.js
Created Nov 24, 2015
simple placeholder polyfill
View placeholder-polyfill.js
;(function() {
var testInput = document.createElement('input');
if('placeholder' in testInput || 'placeHolder' in testInput) {
return false;
var inputs = document.querySelectorAll('input');
for(var i = 0, m = inputs.length; i < m; i++) {
var input = inputs[i];
var inputPlaceholder = input.getAttribute('placeholder');
gustavopaes / log.js
Created Jan 3, 2014
Active (or not) console log.
View log.js
var log = /debug=true/.test( ? (function(nav) {
// ie
if(/MSIE/.test(nav) === true) return console.log;
return function() {
console.log.apply(console, arguments);
})(navigator.userAgent) : function() {};
gustavopaes / underplate.js
Created Sep 9, 2013
underplate it's just the template engine used by underscore Lib. I just removed all underscore code to can use the good template engine. All code here was writed by underscore team, it's not my own. Based at Underscore.js 1.5.2.
View underplate.js
* underplate it's just the template lib used by underscore lib. I just
* removed all underscore code to can use just the good template engine.
* All code here was writed by underscore team.
* Based at Underscore.js 1.5.2
* @licence The MIT License (MIT)
You can’t perform that action at this time.