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
class Rectangle: | |
def __init__(self, side_a, side_b): | |
self.side_a = side_a | |
self.side_b = side_b | |
def __repr__(self): | |
return "Rectangle(%.1f, %.1f)" % (self.side_a, self.side_b) | |
class Circle: |
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
from django.db import models | |
from django.template.defaultfilters import slugify | |
from transliterate import translit | |
class Category(models.Model): | |
name = models.CharField(max_length=128) | |
views = models.IntegerField(default=0) | |
likes = models.IntegerField(default=0) | |
slug = models.SlugField(unique=True) |
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 |
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
/** | |
* @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
<?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
{ | |
"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
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
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 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(); |
OlderNewer