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
// 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') |
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
///////////////////// | |
// Connect | |
try { | |
$host = "localhost"; | |
$database = "learning_pdo"; | |
$db = new PDO("mysql:host=$host;dbname=$database;charset=utf8","antonio","123"); | |
} |
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
/* | |
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. |
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
$ vue init webpack-simple my-project | |
$ cd my-project | |
$ npm install | |
$ npm run dev |
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
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>' | |
}); |
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
///////////////////////////////////////// | |
// Let e const sao block scoped | |
{ | |
let a = 2; | |
const b = "Hey"; | |
console.log(a,b); | |
} | |
///////////////////////////////////////// |
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
import Vue from "vue" | |
import App from "./App.vue"; | |
import VueRouter from "vue-router"; | |
import User from "./components/user/User.vue"; | |
import Home from './components/Home.vue'; | |
Vue.use(VueRouter); | |
const router = new VueRouter( | |
{ |
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
<?php | |
$path ='/dir0/dir1/myfile.php'; | |
$file = 'file1.txt'; | |
// Return filename | |
echo basename($path); | |
// Return filename without ext | |
echo basename($path, '.php'); |
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
$url = 'http://server.com/path'; | |
$data = array('key1' => 'value1', 'key2' => 'value2'); | |
// use key 'http' even if you send the request to https://... | |
$options = array( | |
'http' => array( | |
'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
'method' => 'POST', | |
'content' => http_build_query($data) | |
) |
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
// Emitter.js | |
// function constructor for event | |
function Emitter() { | |
this.events = {}; | |
} | |
// prototype method to add listener (array of functions) | |
Emitter.prototype.on = function (type, listener) { | |
this.events[type] = this.events[type] || []; | |
this.events[type].push(listener); |
OlderNewer