Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
$price = 100; | |
$products = 9; | |
echo $price * $products/2 + ($products&1 ? $price/2 : 0); // 500 |
<template> | |
<div> | |
<input ref="input" type="text" v-model="localValue" /> | |
<slot :localValue="localValue" :formattedDate="formattedDate"> | |
{{ formattedDate }} | |
</slot> | |
<!-- parent can now use 'render prop through scoped slot' --> | |
<!-- | |
<DatePickerComponent slot-scope="{localValue, formattedDate}" :value="value" @input="handleChildInput" @clear="clearChildInput"> | |
{{ formattedDate }} |
const Alexa = require('ask-sdk'); | |
const LaunchRequestHandler = { | |
canHandle(handlerInput) { | |
const request = handlerInput.requestEnvelope.request; | |
return request.type === 'LaunchRequest' | |
}, | |
handle(handlerInput) { | |
#!/bin/bash | |
usage() { echo "usage: --coursename [--coursename \"build-a-react-app-with-redux\"] --type [--type \"courses|lessons\"]" 1>&2; exit 1; } | |
OPTS=$(getopt -o c:t: --long coursename:,type: -n 'download_egghead_videos.sh' -- "$@") | |
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi | |
eval set -- "$OPTS" |
<?php | |
/** | |
* Grab the url of a publicly embeddable video hosted on vimeo | |
* @param str $video_url The "embed" url of a video | |
* @return str The url of the thumbnail, or false if there's an error | |
*/ | |
function grab_vimeo_thumbnail($vimeo_url){ | |
if( !$vimeo_url ) return false; | |
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) ); |
function parseJwt (token) { | |
var base64Url = token.split('.')[1]; | |
var base64 = base64Url.replace('-', '+').replace('_', '/'); | |
return JSON.parse(window.atob(base64)); | |
}; |
<?php | |
# Fill our vars and run on cli | |
# $ php -f db-connect-test.php | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'host'; | |
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
<?php | |
if (!function_exists('html_build_attributes')) { | |
/** | |
* Generate a string of HTML attributes | |
* | |
* @param array $attr Associative array of attribute names and values. | |
* @param callable|null $callback Callback function to escape values for HTML attributes. | |
* Defaults to `htmlspecialchars()`. | |
* @return string Returns a string of HTML attributes. |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"