- id:integer
- title:string
- pages:integer
- cover:image
- weight:integer
- price:integer
- illustrations - модель (это что?)
- genres - модель (много)
- series - модель (одна)
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
# Я только-только начал изучать Ruby, мне очень понравилось то, что | |
# в языке очень много сахара. Но при этом там нет сахара для быстрых | |
# конструкторов, которые есть даже в C++ и CS | |
# constructor: (@name, @age) -> | |
class PersonOld | |
def initialize(name, age) | |
# вот эти строки меня и бесят | |
@name = name | |
@age = age |
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
class Intersection { | |
constructor(id) { | |
this.id = id | |
this.roads = [] | |
this.timeBeforeArrival = Infinity | |
} | |
addRoad({ destination, drivingTime }) { | |
this.roads.push({ destination, drivingTime }) | |
} |
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 getSize(field) { | |
return Math.sqrt(field.length) | |
} | |
function new2D(size, filler = () => 0) { | |
return new Array(size).fill() | |
.map((_, i) => new Array(size).fill() | |
.map((_, j) => filler(i, j))) | |
} |
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
package handlers | |
// import ( | |
// "io" | |
// "net/http" | |
// "os" | |
// "path/filepath" | |
// "github.com/satori/go.uuid" |
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
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#428bca, 6.5%)", | |
"@brand-success": "#5cb85c", |
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
func longFunc(x float64) float64 { | |
var sum float64 = 0 | |
for i := float64(0); i < x; i++ { | |
sum = math.Sin(i) | |
} | |
return sum | |
} |
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
#include <iostream> | |
#include <chrono> | |
#include <cmath> | |
int main() { | |
double sum; | |
auto start = std::chrono::system_clock::now(); | |
for (double i = 0; i < 1000000; i++) { |
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
#!/usr/bin/env bash | |
normalize_index() { | |
local index=$1 | |
printf "%02d" $index | |
} | |
source_name() { | |
local index=$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
package prompter_test | |
import ( | |
"fmt" | |
"reflect" | |
"testing" | |
"github.com/the-varlog/with/prompter" | |
) |
OlderNewer