- 10:30 BG 4.5 mmol/litre
- Run:
- 6k
- 5:11 mins/km pace
- Elevation gain: 76m
- Max elevation: 107m
- 11:10 BG 6.2 mmol.litre
- Food (carbs)
- 11:50 BG 5.5 mmol/litre
- 12:30 BG 6.3 mmol/litre
View fn comp.rb
Add = ->(add, n) { n + add } | |
Times = ->(times, n) { n * times } | |
AddOne = Add.curry.call(1) | |
TimesFour = Times.curry.call(4) | |
AddOneTimesFour = AddOne >> TimesFour | |
AddOneTimesFour.(2) # => 12 |
View rspec.rb
require "bundler/inline" | |
gemfile(false) do | |
source "https://rubygems.org" | |
gem "rspec" | |
gem "pry-byebug" | |
end | |
require 'rspec/autorun' |
View spec.rb
require "bundler/inline" | |
gemfile(false) do | |
source "https://rubygems.org" | |
gem "dry-struct", '0.5' | |
gem "dry-types", '0.14' | |
gem 'rails_event_store-rspec', '1.0.0' | |
gem "pry-byebug" | |
gem 'activesupport' | |
end |
View stats.md
View 00_README.md
ruby basic.rb
ruby aggregate_root.rb
View ActionPolicy_and_SimpleDelegator.md
Problem: When wrapping a model using SimpleDelegator
and passing to authorize!
an undefined method _policy_cache_key
error occurs.
This is, I think, because ActionPolicy uses refinements to add a method _policy_cache_key
to Object
.
However SimpleDelegator
does not inherit from Object
, but maybe BasicObject
.
To fix this we need to pass the unwrapped model to authorize!
or add the missing method, _policy_cache_key
, to our wrapper object.
In controller or mutation:
View EXAMPLE.md
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'activerecord'
gem 'sqlite3'
gem 'rspec'
gem 'pry'
end
View HOWTO_PUSH_TO_SPEAK_MUTE.md
This works for all mics including webcam mics.
bin/mic-on
#!/usr/bin/env bash
# toggle webcam mic
amixer -c 1 sset Mic cap
# toggle default mic
View HOWTO
Hold power button for 5 seconds to enter pairing mode | |
Open Bluetooth Devices and press Search | |
Right click UTAXO UT-BH001 and click Pair | |
Right click UTAXO UT-BH001 and press Add audio sink | |
Set volume in PulseAudio Volume Control (pavucontrol) |
NewerOlder