Skip to content

Instantly share code, notes, and snippets.

View antoniojps's full-sized avatar
🐬
Always learning

António Santos antoniojps

🐬
Always learning
View GitHub Profile
@antoniojps
antoniojps / vue-component.js
Last active April 9, 2017 14:50
Componentes do Vue
Vue.component('meu-componente',{
el: '.class',
// criamos funcao que retorna objetos para que nao interfiram com os outros componentes
data: function(){
return {
foo: 'bar'
}
},
template: '<p>{{foo}}</p>'
});
@antoniojps
antoniojps / vue-cli
Last active April 9, 2017 14:50
Comandos para começar novo projeto Vue
$ vue init webpack-simple my-project
$ cd my-project
$ npm install
$ npm run dev
/*
HTTPS no Domain
Rate limiting
PDO Prepared statements
# Hash sensitive data
# Check the ORIGIN header
Check the REFERER header
If the Origin header is not present, verify the hostname in the
Referer header matches the site's origin.
@antoniojps
antoniojps / pdo.php
Last active April 9, 2017 14:49
PHP - PDO Connect e prepared statements
/////////////////////
// Connect
try {
$host = "localhost";
$database = "learning_pdo";
$db = new PDO("mysql:host=$host;dbname=$database;charset=utf8","antonio","123");
}
@antoniojps
antoniojps / tweenmax.js
Last active April 9, 2017 14:49
GSAP Tweenmax
// BASICO
var img = $('img'),
h2 = $('h2'),
tl = new TimelineMax();
tl
//from,fromTo, ou to, (elemento, tempo, opcoes)
.from(h2,0.3,{y:-15,autoAlpha:0,ease:Power1.easeOut})
// 0.15 seconds earlier than previous
.from(img,1,{y:-15,autoAlpha:0,ease:Power1.easeOut},'-=0.15')