Skip to content

Instantly share code, notes, and snippets.

Sérgio Lopes sergiolopes

Block or report user

Report or block sergiolopes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sergiolopes /
Last active Apr 3, 2018
Retorna o tempo total em segundos de um arquivo do ScreenFlow
# 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)
if [ "$file" = "" ] || [ ! -d "$file" ]; then
echo Passe o nome do arquivo pra detectar a duração
sergiolopes /
Created Jun 6, 2016
Extrai textos das noticias do nerdnews
for PAGINA in {1..2}; do
curl -s -L$PAGINA/ | sed -n 's/.*href="\(https:\/\/\/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
sergiolopes / lazyload-v2.js
Last active Apr 17, 2020
Lazy load de imagens beeem simples
View lazyload-v2.js
// 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;
sergiolopes / nginx.conf
Created Apr 7, 2016
config de server static simples com gzip
View nginx.conf
server {
listen 3030;
root /Users/alura/performance-web/site;
gzip on;
gzip_types text/css application/javascript image/svg+xml;
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
defaults -currentHost write disableHotPlug -bool true
defaults write reduceTransparency -bool true
defaults write FXEnableExtensionChangeWarning -bool false
defaults write ShowStatusBar -bool true
defaults write AppleShowAllFiles -bool true
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write DoNotOfferNewDisksForBackup -bool true
hash tmutil &> /dev/null && sudo tmutil disablelocal
View nginx.conf
server {
listen 12000;
location / {
set $vimeo_host $arg_host;
proxy_pass $vimeo_host;
proxy_buffering off;
sergiolopes / 4shared.js
Last active Jul 2, 2017
urls do google drive / scribd
View 4shared.js
javascript:void function(){
var txt = []'.fname h1 a')).map(el => el.href).reduce((url,acc) => acc + '\r\n' + url);
var ta = document.createElement('textarea');
ta.value = txt;;
View gist:fe4fc275fca6b3115a02
function whackWebkitMatchesSelector() {
var oldMatches = Element.prototype.webkitMatchesSelector
function newMatches(selector) {
try {
return, selector)
catch (err) {
return false
sergiolopes / boleto.js
Created Oct 30, 2015
Bookmarklet pra colar codigo de boleto no home banking do santander
View boleto.js
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];
sergiolopes / SassMeister-input.scss
Created Aug 5, 2015
Generated by
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
h1 {
font-size: 1em;
@media (min-width: 600px) {
font-size: 2em;
You can’t perform that action at this time.