This Space Between Us

“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it Currently working for GenieBelt who are based in Copenhagen, Denmark ...”

module ActionView
module Helpers
module FormOptionsHelper
def option_groups_from_collection_for_select(collection, group_method, group_label_method, option_key_method, option_value_method, selected_key = nil)
collection.map do |group|
next options_for_select([group], selected_key) if value_for_collection(group, group_method).is_a?(String)
option_tags = options_from_collection_for_select(
value_for_collection(group, group_method), option_key_method, option_value_method, selected_key)
content_tag("optgroup", option_tags, label: value_for_collection(group, group_label_method))
end.join.html_safe
end
end
end
end
Quick, dirty colour wheel for Uncle Simon easily adapted from this example code.
https://www.essycode.com/posts/create-color-wheel-javascript-d3/

Should probably Stimulusorizificate it.
And again…
/Users/rl/.node-gyp/16.5.0/include/node/v8-internal.h:454:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'?
!std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
~~~~~^~~~~~~~~~~
remove_cv
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
^
1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/rl/repos/rostering/vendor/engines/sard_core/ui/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:394:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/usr/local/Cellar/node/16.5.0/bin/node" "/Users/rl/repos/rostering/vendor/engines/sard_core/ui/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/rl/repos/rostering/vendor/engines/sard_core/ui/node_modules/node-sass
gyp ERR! node -v v16.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not okYeah, srsly dude. This isn’t right for us either. I think that brew upgrade I did last night broke something, must have upgraded node. Apparently upgrading beyond node-sass 6.0.1 is fine now. Last time this happened I had to downgrade node.
No, can’t see anything above 6.0.1 out there :S I need to get back to node@14 again.
Robs-MacBook-Pro:ui rl$ brew unlink node
Unlinking /usr/local/Cellar/node/16.5.0... 7 symlinks removed.
Robs-MacBook-Pro:ui rl$ brew link --overwrite node@14
Linking /usr/local/Cellar/node@14/14.17.0... 3872 symlinks created.What a faff. Now I can play with d3
module Rack
module Utils
def append_to_query_string(url, params = {})
base, query = url.split('?')
params = parse_query(query).merge(params.stringify_keys)
params = params.sort_by { |k, _v| k.to_s }.to_h
query = build_query(params)
[base, query].reject(&:blank?).join('?')
end
module_function :append_to_query_string
end
endwindow.BLAHUtils = {
isPresent: function(object) {
return object != undefined && object.toString().trim() !== ''
},
presense: function(object) {
return this.isPresent(object) ? object : null
},
appendToQueryString: function(url, params = {}) {
[base, query] = url.split('?')
params = {
...this.parseQuery(query),
...params
}
query = this.buildQuery(params)
return [base, query].filter(v => this.isPresent(v)).join('?')
},
parseQuery: function(query) {
if (!this.isPresent(query)) {
return {}
}
return query.split('&').reduce((h, pair) => {
[k, v] = pair.split('=')
h[k] = decodeURIComponent(v)
return h
}, {})
},
buildQuery: function(params) {
return Object.entries(params).map(([k, v]) => {
return [k, encodeURIComponent(v)].join('=')
}).join('&')
}
}
USB debugging on a Redmi.
https://www.syncios.com/android/how-to-debug-xiaomi-redmi-phone.html
This doesn’t appear anywhere in our codebase. Does iPhone Safari inject this under some circumstances?
undefined is not an object (evaluating 'document.getElementsByTagName('video')[0].webkitExitFullScreen')
I do know how to write, but today the only thing I can make out is Nagios and rubocop -A

Somewhere in there there is something about JSONAPI-Resources attributes, maybe.
Looks like Rails 6.0.4 upgrade has mangled the SQL JSONAPI-Resources is constructing.
Rswag::Specs::UnexpectedResponse:
Expected response code '500' to match '200'
Response body: {
"errors": [
{
"title": "Internal Server Error",
"detail": "Internal Server Error",
"code": "INTERNAL_SERVER_ERROR",
"status": "500",
"meta": {
"exception": "Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.\"id\" AS \"users_id\", users.last_name, users.first_name FROM `users` INNER JOIN `' at line 1",
The backtrace has lead me here.
From: /Users/rl/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.4/lib/active_record/relation/calculations.rb:186 ActiveRecord::Calculations#pluck:
181: def pluck(*column_names)
182: if loaded? && (column_names.map(&:to_s) - @klass.attribute_names - @klass.attribute_aliases.keys).empty?
183: return records.pluck(*column_names)
184: end
185:
=> 186: binding.pry
187:
188: if has_include?(column_names.first)
189: relation = apply_join_dependency
190: relation.pluck(*column_names)
191: else
192: klass.disallow_raw_sql!(column_names)
193: relation = spawn
194: relation.select_values = column_names
195: result = skip_query_cache_if_necessary { klass.connection.select_all(relation.arel, nil) }
196: result.cast_values(klass.attribute_types)
197: end
198: end
[1] pry(#<User::ActiveRecord_Relation>)> column_names
=> ["\"users\".\"id\" AS \"users_id\"", "users.last_name", "users.first_name"]
What’s up with that? Looking.
You wake in a dark room and someone has only gone and tainted your master branch by merging in multiple commits spanning weeks of work. We can’t possibly unpick 100+ commits, what the hell even were they? But we need master back as it was.
We can however, reset our master to a particular commit in the past that we trust.
git checkout master
git reset --hard <somehash>
git push --force origin <somehash>:master
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:somerepo/someproject.git
+ <someotherhash>...<somehash> <somehash> -> master (forced update)There were tears of joy and shaky hands, but it was fine.