This file contains hidden or 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
{ | |
"title": "Takeout API", | |
"discoveryVersion": "v1", | |
"ownerName": "Google", | |
"version_module": true, | |
"resources": { | |
"exports": { | |
"methods": { | |
"get": { | |
"flatPath": "v2/{service}/exports/{exportId}", |
This file contains hidden or 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
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); | |
if (isSafari) { | |
if (constraints.offerToReceiveAudio) { | |
pc.addTransceiver('audio'); | |
} | |
if (constraints.offerToReceiveVideo) { | |
pc.addTransceiver('video'); | |
} |
This file contains hidden or 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
var YearView = View.extend({ // make a subclass of View | |
startDate: null, | |
endDate: null, | |
days: [], | |
initialize: function() { | |
// called once when the view is instantiated, when the user switches to the view. | |
// initialize member variables or do other setup tasks. | |
}, |
This file contains hidden or 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 | |
Route::group(['prefix' => 'v1.1'], function () { | |
Route::get('users', function () { | |
// Matches The "/v1.1/users" URL | |
}); | |
}); | |
Route::group(['prefix' => 'v2.0'], function () { | |
Route::get('users', function () { | |
// Matches The "/v2.0/users" URL |
This file contains hidden or 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
SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; |
This file contains hidden or 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
#!/bin/sh | |
echo "Switch to working folder" | |
cd /var/www/ | |
echo "Pulling latest code" | |
sudo git reset --hard origin/master && sudo git pull | |
echo "Running Magento 2 deployment script..." | |
echo "Removing ./var/generation, ./var/view_preprocessed and ./pub/static folders..." |
This file contains hidden or 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
/** | |
* Generates the string for the Haversine function. We assume that the `zipcode`, `latitude`, | |
* and `longitude` columns are named accordingly. We are also not doing much error-checking | |
* here; this is a simple text cruncher to make things prettier. | |
* We may also be integrating some extra SQL in, passed in via the $extra parameter | |
* | |
* @param string $table The table to search in | |
* @param float $lat The latitude part of the reference coordinates | |
* @param float $lng The longitude part of the reference coordinates | |
* @param int $radius The radius to search within |
This file contains hidden or 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
#!/bin/sh | |
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz | |
tar xfvz mysql-5.7* | |
echo "stopping mamp" | |
sudo /Applications/MAMP/bin/stop.sh | |
sudo killall httpd mysqld | |
echo "creating backup" |
This file contains hidden or 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
UPDATE callbacks cb | |
INNER JOIN clients c | |
ON c.id = cb.client_id | |
SET cb.client_user_id = c.user_id |
This file contains hidden or 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 | |
date_default_timezone_set('Asia/Ho_Chi_Minh'); | |
include_once __DIR__ . '/simple_html_dom.php'; | |
// Connecting, selecting database | |
$host = '127.0.0.1'; | |
$user = 'root'; | |
$pass = 'root'; | |
$dbName = 'lottery'; |
NewerOlder