$ rake ts:configure
/Users/the-teacher/.rvm/gems/[email protected]/gems/compass-core-1.0.1/lib/compass/core/caniuse.rb:72: warning: circular argument reference - browsers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TheComments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WARNING!
StateMachine patch for Rails4 will be applied
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
# USAGE: | |
# rails runner rails-models-to-typescript-schema.rb > app/javascript/types/schema.d.ts | |
Rails.application.eager_load! | |
models = ActiveRecord::Base.descendants.reject { |i| i.abstract_class? } | |
belongs_to = true | |
has_many = 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
Test |
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
// Идея. all принимает набор функций, которые возвращают промисы | |
// all содержит счетчик промисов к исполнению, массив с итоговым результатом, и итоговые коллбэки | |
// При выполнении промисы вызывают метод, который предоставляется all, чтобы проинформировать о совем выполнении и результате | |
// Внутри all счетчик снижается до нуля, пополняется массив результатов, при достижании нуля вызывается массив финальных колбэков, | |
// которые были устанавлены через then | |
// Какая идея предполагалась по "красоте" в оригинальном решении? | |
// Я предполагаю что оригинальный Promis.all и прочие промисы имеют общий интерфейс и проблем с обментом информации об исполнении у них не возникает | |
// Если делать свой собственный all -- то тут надо что-то придумывать отдельное. А что предполагалось? |
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
module.exports = { | |
stories: ['../stories/**/*.stories.js'], | |
addons: ['@storybook/addon-actions', '@storybook/addon-links'], | |
webpackFinal: async config => { | |
/* | |
* Drop babel-loader for `.js|.md` pattern. | |
* (It's the first rule in the rules list.) | |
* | |
* It turned out that storybook had a conflict in the babel-loader configuration |
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 PostsController < ApplicationController | |
def index | |
# ... | |
end | |
def show | |
# ... | |
end | |
def create |
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
# сохранить все текущие данные где-то | |
console_run `pg_dump opencook.ru > ./DUMP/orifinal_dump.opencook.ru` | |
console_run `cp -R ./public/uploads ./DUMP/original_files_dump` | |
# Хреначим прямо на живой базе | |
# Не создавая соединений | |
# Не создавая промежуточных моделей | |
User.update_all(password: 'password') | |
Post.destroy_if(ЧЕТНЫЕ) |
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 React from 'react' | |
import 'jest-dom/extend-expect' | |
import { render, cleanup } from 'react-testing-library' | |
import TestingRouter from './TestingRouter' | |
import Task from './Task' | |
afterEach(cleanup) |
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 React from 'react' | |
import { Router, Route } from 'react-router-dom' | |
import { createMemoryHistory } from 'history' | |
const history = createMemoryHistory() | |
const TestingRouter = ({ ComponentWithRedirection, RedirectUrl }) => ( | |
<Router history={history}> | |
<Route path="/" exact={true} render={() => <ComponentWithRedirection />} /> | |
<Route path={RedirectUrl} render={() => <div>{RedirectUrl}</div>} /> |
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 React from 'react' | |
import 'jest-dom/extend-expect' | |
import { render, cleanup } from 'react-testing-library' | |
import SystemError from './SystemError' | |
afterEach(cleanup) | |
describe('SystemError', () => { |
NewerOlder