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 |
[19-02-16 02:41:37.001] NativeScript Sidekick version: 1.16.0-v.2019.2.7.3 | |
[19-02-16 02:41:38.162] Checking for updates... | |
[19-02-16 02:41:38.403] No updates available. | |
[19-02-16 02:41:40.029] Dependencies versions: NodeJS: 11.6.0, npm: 6.5.0, NativeScript CLI: 5.2.0. | |
[19-02-16 02:41:42.137] (CLI) Using NativeScript CLI located in /usr/local/lib/node_modules/nativescript | |
[19-02-16 02:41:46.117] (CLI) Searching for devices... | |
[19-02-16 02:41:48.445] Loaded CLI extension nativescript-cloud, version 1.16.0. | |
[19-02-16 02:41:48.450] Loaded CLI extension nativescript-starter-kits, version 0.3.5. | |
[19-02-16 02:41:58.593] The user Guillermo Palafox logged in. | |
[19-02-16 02:42:02.147] App with path: /Volumes/HD2/Proyectos/CurrentDev/app-golf/Devs/app-golf was opened. |
<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. |