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
import psycopg2 as pg | |
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT | |
class Database: | |
def __init__(self, host='127.0.0.1', port='5432', username='postgres', password='', database=''): | |
self.host = host | |
self.port = port | |
self.username = username | |
self.password = password |
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
public static function pnrAddMultiElements11(Request $request) | |
{ | |
$params = new SimpleXMLElement('<PNR_AddMultiElements></PNR_AddMultiElements>'); | |
$params->addChild('pnrActions'); | |
$params->pnrActions->addChild('optionCode'); | |
$params->pnrActions->optionCode = '0'; | |
foreach ($request->get('travellers') as $traveller) { | |
$params->addChild('travellerInfo'); |
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
public function activateCode(Request $request) | |
{ | |
$code = $request->get('promo_code'); | |
if ($this->user->activation_code || $this->user->promo_code_first == $code || $this->user->promo_code_second == $code) { | |
return response()->json([], 405); | |
} | |
$referral = User::wherePromoCodeFirst($code)->first(); | |
$referral_second = User::wherePromoCodeSecond($code)->first(); |
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
public function newTasks(Request $request) | |
{ | |
// callback for return all tasks | |
$returnResponse = function($tasks) { | |
$response = []; | |
foreach ($tasks as $task) { | |
$response[] = [ | |
'id' => $task->id, | |
'package_name' => $task->package_name, | |
'title' => $task->title, |
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
public function createUser(Request $request): JsonResponse | |
{ | |
$response = function ($user) { | |
return response()->json([ | |
'token' => $user->token, | |
'promo' => $user->promo, | |
], 200); | |
}; | |
$user = User::whereEmail($request->get('email'))->first(); |
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
{ | |
"stay": { | |
"checkIn": "2018-03-15", | |
"checkOut": "2018-03-17" | |
}, | |
"hotels": { | |
"hotel": [ | |
"165", | |
"357", |
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 | |
namespace App\Services\Hotelbeds\Hotel\Search; | |
use Amadeus\Client; | |
use Amadeus\Client\Params; | |
use Amadeus\Client\RequestOptions\Fare\MPDate; | |
use Amadeus\Client\RequestOptions\Fare\MPItinerary; | |
use Amadeus\Client\RequestOptions\Fare\MPLocation; | |
use Amadeus\Client\RequestOptions\Fare\MPPassenger; |
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
/** | |
* @SWG\Post( | |
* path="/login/api", | |
* summary="Store new or update existing device", | |
* tags={"Login"}, | |
* description="Store new or update existing device. <strong>Authorization header required</strong>", | |
* operationId="postDevice", | |
* consumes={"application/json", "application/x-www-form-urlencoded"}, | |
* produces={"application/json"}, | |
* @SWG\Parameter( |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>jQuery UI Draggable - Default functionality</title> | |
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | |
<link rel="stylesheet" href="/resources/demos/style.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<style> |
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 ATM = { | |
is_auth: false, | |
current_user:false, | |
current_type:false, | |
// all cash of ATM | |
cash: 2000, | |
// all available users | |
users: [ | |
{number: "0000", pin: "000", debet: 0, type: "admin"}, // EXTENDED |
NewerOlder