Skip to content

Instantly share code, notes, and snippets.


Zeno Rocha zenorocha

View GitHub Profile
View showFirstCellInGoogleSheetAsiOSWidget.js
// Modified from @mutsuda's
// by @levelsio
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = ""
// 4) Install Scriptable @
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
View git-clone.zsh
clone() {
git clone$1/$2.git
zenorocha /
Last active February 17, 2023 12:13
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file


zenorocha /
Last active March 26, 2023 09:00
New Firebase Auth vs Old Firebase Auth
zenorocha / query.sql
Last active April 8, 2018 02:01
Median Page Weight ~ BigQuery
View query.sql
NTH(50, quantiles(INTEGER(bytesHtml/1024)))
+ NTH(50, quantiles(INTEGER(bytesHtmlDoc/1024)))
as html,
NTH(50, quantiles(INTEGER(bytesCSS/1024)))
as css,
NTH(50, quantiles(INTEGER(bytesJS/1024)))
zenorocha /
Last active April 8, 2018 02:01
Interview for "The Open Sourcer"
You've written in the past about the importance of talks for open source projects' adoption. How would you recommend a developer new to the community approach this?

Back in 2011, I was working with ActionScript but what I really wanted to do was HTML5. My father always said that if I wanted to learn something for real, I'd have to teach it. So I sent a proposal to speak about HTML5 at a free software forum in a very small city.

I didn't expect them to accept it but they did. I had no experience with HTML5 and had to give an entire presentation about it. I could have freaked out and give them some lame excuse for not to do it, but I put myself together and studied like crazy. Couple weeks later I gave the talk and survived to tell this story.

You see, most people think they should be experts in order to give a talk. That is just not true. Once you realize that every human being is different and we all have the capacity to teach something to someone else, you'll understand that you can do anything.


View launchpad-docs-search.js
var searchInput = document.querySelector('#search-input');
searchInput.addEventListener('input', function() { // Triggers when a user writes something
Launchpad // Uses Launchpad API Client to make an AJAX request
.url('') // Points to the API URL where the data is stored
.search('*', 'prefix', searchInput.value) // Filters results based on what the user typed
.highlight('content') // Automatically highlights the words that matched our query
.get() // Specifies what kind of HTTP request are we going to make
.then(function(result) {
// Renders the result in the page
View self-signed.zsh
#!/usr/bin/env zsh
openssl genrsa -des3 -out self-signed.pass.key 2048
openssl rsa -in self-signed.pass.key -out self-signed.key
openssl req -new -key self-signed.key -out self-signed.csr
openssl x509 -req -days 365 -in self-signed.csr -signkey self-signed.key -out self-signed.crt
echo "SHA1 fingerprint:\n"
openssl x509 -in self-signed.crt -sha1 -noout -fingerprint
zenorocha / entry.js
Last active July 20, 2018 06:56
Bundling Clipboard.js distribution with Webpack
View entry.js
var Clipboard = require('clipboard');
zenorocha / entry.js
Last active April 8, 2018 02:01
Bundling Clipboard.js' distribution with Webpack
View entry.js
var Clipboard = require('clipboard');