View duracao.sh
#!/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
#!/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
(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
server { | |
listen 3030; | |
root /Users/alura/performance-web/site; | |
gzip on; | |
gzip_types text/css application/javascript image/svg+xml; | |
} |
View osx.sh
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
server { | |
listen 12000; | |
location / { | |
set $vimeo_host $arg_host; | |
resolver 8.8.8.8; | |
proxy_pass $vimeo_host; | |
proxy_buffering off; | |
} | |
} |
View gist:fe4fc275fca6b3115a02
<script> | |
function whackWebkitMatchesSelector() { | |
var oldMatches = Element.prototype.webkitMatchesSelector | |
function newMatches(selector) { | |
try { | |
return oldMatches.call(this, selector) | |
} | |
catch (err) { | |
return false |
View boleto.js
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
h1 { | |
font-size: 1em; | |
@media (min-width: 600px) { | |
font-size: 2em; | |
} |
NewerOlder