- Explain what PDO is and it's role in accessing data
- Explain how to set up environment variables using PHP dotenv
- Explain how to establish and destroy database connections
- Describe what prepared statements are
- Explain how to bind parameters to safely form SQL queries
- Explain how to get the new ID generated from an insert statement
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'; | |
export const Suspense = Vue.extend({ | |
name: 'Suspense', | |
data: () => ({ | |
resolved: false, | |
}), | |
async created() { | |
const setupMethod = (this.$parent as any).setup; | |
if (!setupMethod) { |
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
module.exports = { | |
prefix: '', | |
important: false, | |
separator: ':', | |
theme: { | |
screens: { | |
sm: '640px', | |
md: '768px', | |
lg: '1024px', | |
xl: '1280px', |
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
export let facebookSDK = { | |
mounted () { | |
let _this = this | |
this.$nextTick(() => { | |
window.fbAsyncInit = function () { | |
FB.init({ | |
appId: 'XXX', | |
xfbml: true, | |
version: 'v2.6' | |
}) |
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
<html lang="vi"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Tôn Cường - The simple tutorial Vuejs</title> | |
<link rel="stylesheet" href="assets/css/normalize.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<link rel="stylesheet" href="assets/css/style.css"> |
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 | |
$user = "root"; | |
$password = ""; | |
$name = "%o%"; | |
try{ | |
$conn = new PDO('mysql:host=localhost;dbname=test_db',$user,$password); | |
$query = "SELECT * FROM `test_table` WHERE `name` like :name"; | |
$stmt = $conn->prepare($query); | |
$stmt->bindParam(':name',$name); | |
$stmt->execute(); |
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
'use strict'; | |
var gulp = require('gulp'); | |
var through = require('through2'); | |
// https://gulp.readme.io/docs | |
gulp.task('default', () => { | |
gulp.src('src/**/*') | |
.pipe(pipeFunction()) | |
.pipe(gulp.dest('dist')) |
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
// Helpers. | |
import { convertToText } from './'; | |
/* | |
You would call this when receiving a plain text | |
value back from an API, and before inserting the | |
text into the `contenteditable` area on a page. | |
*/ | |
const convertToMarkup = (str = '') => { | |
return convertToText(str).replace(/\n/g, '<br>'); |
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
body { | |
padding: 0 10%; | |
} | |
p { | |
text-align: left; | |
font-size: 18px; | |
letter-spacing: 0.08px; | |
line-height: 26px; | |
word-wrap: break-word; |
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
/* Source: http://stackoverflow.com/questions/5093398/how-to-check-if-a-user-likes-my-facebook-page-or-url-using-facebooks-api | |
*/ | |
function parsePageSignedRequest() { | |
if (isset($_REQUEST['signed_request'])) { | |
$encoded_sig = null; | |
$payload = null; | |
list($encoded_sig, $payload) = explode('.', $_REQUEST['signed_request'], 2); | |
$sig = base64_decode(strtr($encoded_sig, '-_', '+/')); | |
$data = json_decode(base64_decode(strtr($payload, '-_', '+/'), true)); |
NewerOlder