This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git | |
alias listTags="git tag -l --sort=v:refname | tail -n8" | |
alias branches="git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'" | |
# Other | |
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" | |
# Alias based on this post: https://remysharp.com/2018/08/23/cli-improved | |
alias cat="bat" | |
alias ping="prettyping" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function usePersistedState(key, defaultValue) { | |
const [state, setState] = React.useState( | |
() => JSON.parse(localStorage.getItem(key)) || defaultValue | |
); | |
useEffect(() => { | |
localStorage.setItem(key, JSON.stringify(state)); | |
}, [key, state]); | |
return [state, setState]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
if (/guia-para-viajar/.test(window.location.pathname) || /ruta-de-/.test(window.location.pathname)) { | |
if (/^Guía para viajar/.test(document.querySelector(".entry-title").textContent)) { | |
let index = "" | |
const h2 = document.querySelectorAll("h2") | |
h2.forEach(item => { | |
const content = item.textContent | |
if (!/^Datos básicos/.test(content)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from "react" | |
export const useMount = fn => useEffect(fn, []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOM from 'react-dom' | |
// ... | |
componentDidMount() { | |
document.addEventListener('click', this.handleClickOutside, true) | |
} | |
componentWillUnmount() { | |
document.removeEventListener('click', this.handleClickOutside, true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.minimap.enabled": false, // removes minimap | |
"editor.renderWhitespace": "none", // removes whitespace chars | |
"editor.renderIndentGuides": false, // removes indent guides | |
"editor.renderLineHighlight": "none", // removes line highlight | |
"editor.overviewRulerBorder": false, // removes border from overview ruler (located on the right, same position as the scrollbar) | |
"editor.hideCursorInOverviewRuler": true, // hides cursor mark in the overview ruler | |
"editor.folding": false, // removes the folding feature | |
"editor.occurrencesHighlight": false, // removes highlights occurrences (still works when you select a word) | |
"editor.matchBrackets": false, // removes the highlight of matching brackets (I use Subtle Match Brackets extension for this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[filter "lfs"] | |
required = true | |
clean = git-lfs clean %f | |
smudge = git-lfs smudge %f | |
[user] | |
name = Marcio Barrios | |
email = [email protected] | |
[alias] | |
co = checkout | |
br = branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap 'caskroom/cask' | |
tap 'homebrew/bundle' | |
tap 'homebrew/core' | |
tap 'homebrew/services' | |
tap 'phrase/brewed' | |
tap 'thoughtbot/formulae' | |
brew 'autoconf' | |
brew 'libpng' | |
brew 'freetype' | |
brew 'fontconfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var a = b = 5; | |
})(); | |
console.log(b); | |
// 1. What will be printed on the console? | |
// 2. Rewrite the code to return the same result but with the variable declarations separated | |
// 3. Enable strict mode to explicitly reference the scope |
NewerOlder