Skip to content

Instantly share code, notes, and snippets.

{
"id": 12,
"currency": "BYN",
"restaurant": {
"localization": [
{
"lang": "en",
"name": "Kuechenmeister",
"description": "Belorusian cousines",
"default": true
<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">
Without auth:
GET localhost:9999/api/languages
[
{
"id": 3,
"code": "ru",
"name": "Russian"
},
{
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
typedef struct ModemUcnwfRxInHeaderStruct {
...
uint8_t reserved[16];
uint16_t akzpSyncRely;
uint16_t akzpPhasorNum;
uint8_t reserved[12];
uint8_t payload[0];
} __attribute__((__packed__)) *ModemUcnwfRxInHeader;
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('-')
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}`)
}
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:
@rema7
rema7 / tasks.py
Last active October 4, 2017 11:58
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 = '''
# ...
# microservice_db - is our database name
DB_CONNECTION = 'postgresql+psycopg2://localhost/microservice_db'
try:
from settings_local import * # noqa
except ModuleNotFoundError:
pass