EDITOR=vim rails credentials:editdevelopment:
mailtrap:
user_name: your_mailtrap_user_name
password: your_mailtrap_password
address: your_mailtrap_address| Homebrew has a services manager and can manage its own Java installation, so an easier way to do this is just | |
| # this will install java 1.8, zookeeper, and kafka | |
| brew install kafka | |
| # this will run ZK and kafka as services | |
| brew services start zookeeper | |
| brew services start kafka | |
| That's it. If you want to stop Kafka, just run the brew services commands in reverse: |
| import 'dotenv/config'; | |
| import { NestFactory } from '@nestjs/core'; | |
| import * as repl from 'repl'; | |
| import * as Logger from 'purdy'; | |
| const LOGGER_OPTIONS = { | |
| indent: 2, | |
| depth: 1, | |
| }; |
| import redis | |
| from itertools import izip_longest | |
| import sys | |
| from multiprocessing import Pool | |
| import signal | |
| OLD = "SHARD_ENDPOINT_FOR_OLD_REDIS" | |
| NEW = "SHARD_ENDPOINT_FOR_NEW_REDIS" |
EDITOR=vim rails credentials:editdevelopment:
mailtrap:
user_name: your_mailtrap_user_name
password: your_mailtrap_password
address: your_mailtrap_address| ## Context + metadata | |
| shared_context 'Logged as a user', role: true do | |
| let(:user) { |example| create :user, example.metadata[:role] } | |
| before { login_as user } | |
| end | |
| scenario "Login as a client", role: :client | |
| scenario "Login as a customer", role: :customer | |
| scenario "Login as an admin", role: :admin |
The following instructions are heavily inspired by @pauleve. I modified his instructions and then added details about how to make a shortcut and support Retina/HiDPI displays.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
| class Example extends React.Component< | |
| Props, | |
| State, | |
| Snapshot | |
| > { | |
| static getDerivedStateFromProps( | |
| nextProps: Props, | |
| prevState: State | |
| ): $Shape<State> | null { | |
| // ... |
This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.
| // This is an example of how to fetch external data in response to updated props, | |
| // If you are using an async mechanism that does not support cancellation (e.g. a Promise). | |
| class ExampleComponent extends React.Component { | |
| _currentId = null; | |
| state = { | |
| externalData: null | |
| }; |
| Started GET "/bookmarks" for 127.0.0.1 at 2018-01-11 10:48:37 -0700 | |
| Processing by BookmarksController#index as HTML | |
| User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] | |
| Rendering bookmarks/index.html.haml within layouts/application | |
| Rendered bookmarks/_navbar.html.haml (3.7ms) | |
| Bookmark Exists (0.4ms) SELECT 1 AS one FROM "bookmarks" LIMIT $1 OFFSET $2 [["LIMIT", 1], ["OFFSET", 0]] | |
| Bookmark Load (0.4ms) SELECT "bookmarks".* FROM "bookmarks" ORDER BY "bookmarks"."created_at" ASC LIMIT $1 OFFSET $2 [["LIMIT", 25], ["OFFSET", 0]] | |
| Webpage Load (0.4ms) SELECT "webpages".* FROM "webpages" WHERE "webpages"."id" IN ($1, $2, $3, $4, $5, $6) [["id", 1], ["id", 4], ["id", 5], ["id", 6], ["id", 7], ["id", 8]] | |
| Tag Load (6.6ms) SELECT "tags".* FROM "tags" INNER JOIN "bookmarks_tags" ON "tags"."id" = "bookmarks_tags"."tag_id" WHERE "bookmarks_tags"."bookmark_id" = $1 [["bookmark_id", 5]] | |
| Rendered bookmarks/_bookmark_list_item.html.haml (49.5ms) |