презентации
Ссылки изОблачные API
- https://cloud.google.com/vision/
- https://cloud.google.com/natural-language
- https://cloud.google.com/speech/
- https://cloud.google.com/translate/
#!/usr/bin/env bash | |
function get_headphones_index() { | |
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}') | |
} | |
function get_headphones_mac_address() { | |
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3) | |
temp="${temp%\"}" | |
temp="${temp#\"}" |
Article: https://github.com/puma/puma/blob/master/docs/systemd.md | |
#1 nano /etc/systemd/system/puma.service | |
#2 paste from puma.service | |
Commands: | |
# After installing or making changes to puma.service | |
systemctl daemon-reload | |
# Enable so it starts on boot | |
systemctl enable puma.service |
# from gitlab/spec/support/matchers/exceed_query_limit.rb | |
RSpec::Matchers.define :exceed_query_limit do |expected| | |
supports_block_expectations | |
match do |block| | |
@subject_block = block | |
actual_count > expected_count + threshold | |
end | |
failure_message_when_negated do |actual| |
# Usage: | |
# | |
# class Mail | |
# include SimpleStateMachine | |
# | |
# self.initial_state = 'unread' | |
# self.transitions_map = { | |
# read: {from: 'unread', to: 'read'}, | |
# unread: {from: 'any', to: 'unread'}, | |
# delete: {from: 'any', to: 'deleted'}, |
module SimpleRailway | |
class Result | |
attr_accessor :success, :data | |
def initialize(success, data) | |
@success = success | |
@data = data | |
end | |
def success?; !!success; end | |
def failure?; !success?; end |
1. Change rails version in Gemfile | |
> gem 'rails', '~> 5.1', '>= 5.1.4' | |
2. Remove Gemfile.lock | |
> git rm Gemfile.lock | |
3. Run bundle install command | |
> bundle install --jobs=5 | |
4. Run rails' app update to apply changes to app |
# While having issues with to_partial_path on a view model giving inconsistent results under differing name spaces of controllers | |
# I use the below to see that the look up path and view paths were on an controller and modify. | |
# I've never put the below into production. This is merely something I found while experimenting. | |
# To sort my issue I used the prefixes avaialable and changed name spacing to give correct behaviour | |
class SomeController < ApplicationController | |
# Prepending (or appending) the view path allows you to add the location of view files | |
before_filter :prepend_view_paths |
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems