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
[ | |
{ | |
"line": "Сокольническая", | |
"stations": ["Бульвар Рокоссовского", "Черкизовская", "Преображенская площадь", "Сокольники", "Красносельская", "Комсомольская", "Красные ворота", "Чистые пруды", "Лубянка", "Охотный ряд", "Библиотека имени Ленина", "Кропоткинская", "Парк культуры", "Фрунзенская", "Спортивная", "Воробьёвы горы", "Университет", "Проспект Вернадского", "Юго-Западная", "Тропарёво", "Румянцево", "Саларьево"] | |
}, | |
{ | |
"line": "Замоскворецкая", | |
"stations": ["Алма-Атинская", "Красногвардейская", "Домодедовская", "Орехово", "Царицыно", "Кантемировская", "Каширская", "Коломенская", "Технопарк", "Автозаводская", "Павелецкая", "Новокузнецкая", "Театральная", "Тверская", "Маяковская", "Белорусская", "Динамо", "Аэропорт", "Сокол", "Войковская", "Водный стадион", "Речной вокзал"] | |
}, | |
{ |
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
# config/routes.rb | |
YandexKassaIntegration::Application.routes.draw do | |
# ... | |
scope '/yandex_kassa' do | |
controller 'yandex_kassa', constraints: { subdomain: 'ssl' } do | |
post :check | |
post :aviso | |
get :success | |
get :fail |
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
require 'rubygems' | |
require 'yaml' | |
# A demonstration of YAML anchors, references and handling of nested values | |
# For more info, see: | |
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ | |
stooges = YAML::load( File.read('stooges.yml') ) | |
# => { | |
# "default" => { |
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
# unless there's a really good reason to do so, a view should not be passed a reference to a preexisting DOM element | |
view = new BadPhoneInputView(el: $('#phone')) | |
# instead, write your markup as a string-property of the view prototype to be evaluated at render-time | |
class GoodPhoneInputView extends Backbone.Marionette.ItemView | |
template: "<input type='text' name='phone'><a class='submit' href='#'>submit</a>" | |
# this allows us to unit-test the view in-memory, independently of the document |
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
// Example usage of SortedRouter | |
var SortedRouter = require('./sortedrouter'); | |
var router = new SortedRouter(); | |
// Supports multiple URLs | |
router.route('', 'books', show('<h1>Books</h1>')); | |
router.route('books/new', show('<h1>New Book</h1>')); | |
router.route('books/:id', show('<h1>Show Book</h1>')); |
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
//- pug mixins for underscore template engine | |
//- Examples: | |
+if('js_expression') | |
div ... | |
+else | |
div ... | |
+endIf | |
+each('js_arr','obj,key') | |
|{{key}} : {{obj.prop}} |
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 * as Koa from 'koa'; | |
import { databaseInitializer } from 'initializers/database'; | |
databaseInitializer().then(() => { | |
const app = new Koa(); | |
app.use(async ctx => { | |
ctx.body = 'Works!'; |
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 * as Koa from 'koa'; | |
const app = new Koa(); | |
app.use(async ctx => { | |
ctx.body = "It works!\n"; | |
}); | |
app.listen(3000); |
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
export const databaseInitializer = async () => { | |
return await createConnection({ | |
type : 'postgres', | |
host : '0.0.0.0', | |
port : 5432, | |
username : 'db_user', | |
password : 'db_password', | |
database : 'db_name', | |
entities: [ |
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 * as Koa from 'koa'; | |
import { databaseInitializer } from 'initializers/database'; | |
const bootstrap = async () => { | |
await databaseInitializer(); | |
const app = new Koa(); | |
app.use(async ctx => { | |
ctx.body = "It works!\n"; |
OlderNewer