View duracao.sh
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
#!/bin/bash | |
# Retorna o tempo total em segundos de um arquivo do ScreenFlow | |
# | |
# Requisito: Dar permissão de acessibilidade pro Terminal ou outra App que vai executar | |
# (System Preferences > Security & Privacy > Privacy > Accessibility > Add Application) | |
file=$1 | |
if [ "$file" = "" ] || [ ! -d "$file" ]; then | |
echo Passe o nome do arquivo pra detectar a duração |
View nerdnews.sh
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
#!/bin/bash | |
for PAGINA in {1..2}; do | |
curl -s -L https://jovemnerd.com.br/categoria/nerdnews/page/$PAGINA/ | sed -n 's/.*href="\(https:\/\/jovemnerd.com.br\/nerdnews\/[^"]*\).*/\1/p' | |
done | \ | |
while read link; do | |
curl -s $link > /tmp/nerdtech.html | |
xmllint --html --xpath '//div[@class="title"]/h2/text()' /tmp/nerdtech.html 2> /dev/null |
View lazyload-v2.js
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(){ | |
// como vamos usar o throttle varias vezes (no scroll e no resize), | |
// encapsulei essa funcionalidade numa função | |
function throttle(fn) { | |
fn.jarodei = false; | |
return function(){ | |
if (fn.jarodei) return; | |
fn.jarodei = true; |
View nginx.conf
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
server { | |
listen 3030; | |
root /Users/alura/performance-web/site; | |
gzip on; | |
gzip_types text/css application/javascript image/svg+xml; | |
} |
View osx.sh
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
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false | |
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false | |
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true | |
defaults write com.apple.universalaccess reduceTransparency -bool true | |
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false | |
defaults write com.apple.finder ShowStatusBar -bool true | |
defaults write com.apple.Finder AppleShowAllFiles -bool true | |
defaults write NSGlobalDomain AppleShowAllExtensions -bool true | |
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true | |
hash tmutil &> /dev/null && sudo tmutil disablelocal |
View nginx.conf
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
server { | |
listen 12000; | |
location / { | |
set $vimeo_host $arg_host; | |
resolver 8.8.8.8; | |
proxy_pass $vimeo_host; | |
proxy_buffering off; | |
} | |
} |
View gist:fe4fc275fca6b3115a02
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
<script> | |
function whackWebkitMatchesSelector() { | |
var oldMatches = Element.prototype.webkitMatchesSelector | |
function newMatches(selector) { | |
try { | |
return oldMatches.call(this, selector) | |
} | |
catch (err) { | |
return false |
View boleto.js
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
javascript:void(function(){ | |
var boleto = prompt(); | |
var partes = boleto.trim().split(/[^\d]+/); | |
var iframe = document.querySelector('[name="Principal"]').contentWindow.document.querySelector('[name="Corpo"]').contentWindow.document.querySelector('#iframePrinc').contentWindow; | |
var inputs = iframe.document.querySelectorAll('.lista input'); | |
for (var i = 0; i < inputs.length; i++) { | |
inputs[i].value = partes[i]; |
View SassMeister-input.scss
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
h1 { | |
font-size: 1em; | |
@media (min-width: 600px) { | |
font-size: 2em; | |
} |
NewerOlder