This file contains 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
{ | |
"id": 12, | |
"currency": "BYN", | |
"restaurant": { | |
"localization": [ | |
{ | |
"lang": "en", | |
"name": "Kuechenmeister", | |
"description": "Belorusian cousines", | |
"default": true |
This file contains 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
<v-data-table | |
v-model="selectedItems" | |
:headers="fullHeaders" | |
:items="items" | |
:options="pagination" | |
hide-default-footer | |
:show-select="selectable" | |
:items-per-page="itemsPerPage || itemsLimit" | |
> | |
<template v-slot:[`item.${header.value}`]="{ item, header }" v-for="header in fullHeaders"> |
This file contains 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
Without auth: | |
GET localhost:9999/api/languages | |
[ | |
{ | |
"id": 3, | |
"code": "ru", | |
"name": "Russian" | |
}, | |
{ |
This file contains 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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"id": { | |
"type": "number" | |
}, | |
"name": { | |
"type": "string" |
This file contains 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
typedef struct ModemUcnwfRxInHeaderStruct { | |
... | |
uint8_t reserved[16]; | |
uint16_t akzpSyncRely; | |
uint16_t akzpPhasorNum; | |
uint8_t reserved[12]; | |
uint8_t payload[0]; | |
} __attribute__((__packed__)) *ModemUcnwfRxInHeader; | |
This file contains 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
function drawRating(vote) { | |
let max = 5 | |
vote = vote > 100 ? 100 : vote <= 0 ? 1 : vote | |
const rest = Math.floor((100-vote)/20) | |
let start = [] | |
for (let i = 0; i < max - rest; i++) { | |
start.push('*') | |
} | |
for (let i = max - rest; i < 5; i++) { | |
start.push('-') |
This file contains 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
function sequences(n) { | |
let result = []; | |
if (n < 1) { | |
return result | |
} | |
result.push('1') | |
for (let i = 1; i<n; i++) { | |
prev = result[i-1].split('-').reverse().join('-') | |
result.push(i%2 ? `${i+1}-${prev}` : `${prev}-${i+1}`) | |
} |
This file contains 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
webservice_db: | |
image: postgres:9.6 | |
environment: | |
POSTGRES_PASSWORD: 'db_pwd' | |
POSTGRES_USER: 'db_user' | |
PGDATA: '/data/pgdata' | |
POSTGRES_DB: 'microservice_db_docker' | |
volumes: | |
- ./dbdata:/data/pgdata | |
ports: |
This file contains 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 os | |
from invoke import task, Collection | |
import settings as app_settings | |
LOCAL_SETTINGS = 'settings_local.py' | |
@task | |
def init_config(ctx, db_connection, silent=False): | |
settings_local = ''' |
This file contains 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
# ... | |
# microservice_db - is our database name | |
DB_CONNECTION = 'postgresql+psycopg2://localhost/microservice_db' | |
try: | |
from settings_local import * # noqa | |
except ModuleNotFoundError: | |
pass |
NewerOlder