Skip to content

Instantly share code, notes, and snippets.

View luisdalmolin's full-sized avatar
👨‍💻

Luís Dalmolin luisdalmolin

👨‍💻
View GitHub Profile
@luisdalmolin
luisdalmolin / gravatar.php
Created December 15, 2011 23:49
Pegando imagem do Gravatar com PHP
<?php
function getAvatar() {
$email = 'seu@email.com.br'; // e-mail de cadastro para pegar as imagens
$default = '_img/sem-imagem-perfil.png'; // imagem alternativa para se não existir
$size = 25; // tamanho da imagem
$grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) .
"?d=" . urlencode( $default ) . "&s=" . $size;
return $grav_url;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
@luisdalmolin
luisdalmolin / regexp-name-id.md
Created November 6, 2012 16:37
Remove name and ID attribute

Removendo todos os atributos name e ID

  • \s*(name|id)="[^"]+"\s*
  • # (1 espaço)

Adicionando style="display: block"

  • \s*(border)="[^"]+"\s*
  • border="0" style="display: block"
[
{
"key": "ctrl+cmd+p",
"command": "workbench.action.openRecent"
}
]

Keybase proof

I hereby claim:

  • I am luisdalmolin on github.
  • I am luisdalmolin (https://keybase.io/luisdalmolin) on keybase.
  • I have a public key ASCuTQXJVARZnsbRD-QaLiR7OVMB-9c4aHvhsn1HJAPswQo

To claim this, I am signing this object:

@luisdalmolin
luisdalmolin / nginx.conf
Created March 28, 2017 12:11
Nginx cache config
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|woff|woff2|css|js)$ {
expires 30d;
access_log off;
add_header Pragma public;
add_header Cache-Control "public";
}
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
PagSeguroDirectPayment.getBrand({
cardBin: $scope.card,
success: function(response) {
console.log(response);
},
error: function(response) {
console.log(response);
}
@luisdalmolin
luisdalmolin / worker.js
Last active August 30, 2016 11:58
Service Worker to make the site offline
var version = 'v1::';
// -------------------------------------------------------
// aqui devem ser baixados os recursos offline, que devem vir de uma lista em algum local
// provavelmente alguma API no site
this.addEventListener('install', function(event) {
console.log('Service Worker instalado!');
// return self.clients.skipWaiting();
});
Verifying that +luisdalmolin is my blockchain ID. https://onename.com/luisdalmolin