Skip to content

Instantly share code, notes, and snippets.

View drdpedroso's full-sized avatar
🌱
The day you plant the seed is not the day you eat the fruit

Eduardo Pedroso drdpedroso

🌱
The day you plant the seed is not the day you eat the fruit
  • São Paulo, Brazil
View GitHub Profile
@drdpedroso
drdpedroso / terminal-git-branch-name.md
Created June 22, 2019 06:54 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@drdpedroso
drdpedroso / providerCompose.js
Created June 12, 2019 10:59 — forked from stolinski/providerCompose.js
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}
const stream = require('stream')
const cache = new Map() // you might wanna use an lru here
function createCacheStream (url) {
const buf = []
return stream.Transform({
transform: function (data, enc, cb) {
buffer.push(data)
cb(null, data)
},