ssh-keygen -H -F hostname
Or, if SSH runs on port other than 22
ssh-keygen -H -F '[hostname]:2222'
# credit https://blog.widefix.com/fake-time-dot-now-in-production/ | |
url = "<HTTP LINK>" | |
code = open(url).read | |
puts code | |
# It’s important to carefully review the code before evaluating it, to ensure it is the original, | |
# intended code and not something malicious. | |
# Only after confirming the authenticity of the code should you include it as a module: | |
# This can be done by raising an error if a specific line of code is not present. |
# Source: https://evilmartians.com/chronicles/squash-n-plus-one-queries-early-with-n-plus-one-control-test-matchers-for-ruby-and-rails | |
# Gemfile | |
gem 'n_plus_one_control', group: :test | |
# rails_helper.rb | |
require 'n_plus_one_control/rspec' | |
# spec.rb | |
context 'N+1', :n_plus_one do |
// https://stackoverflow.com/questions/12043187/how-to-check-if-hex-color-is-too-black | |
function luma(color){ | |
var c = color.substring(1); // strip # | |
var rgb = parseInt(c, 16); // convert rrggbb to decimal | |
var r = (rgb >> 16) & 0xff; // extract red | |
var g = (rgb >> 8) & 0xff; // extract green | |
var b = (rgb >> 0) & 0xff; // extract blue | |
return 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709 |
Dec 26 18:36:31 amit kernel: [ 4.629766] kvm: disabled by bios | |
Dec 26 18:36:31 amit kernel: [ 4.629937] EDAC amd64: F17h_M70h detected (node 0). | |
Dec 26 18:36:31 amit kernel: [ 4.629984] EDAC amd64: Node 0: DRAM ECC disabled. | |
Dec 26 18:36:31 amit kernel: [ 4.644529] [TTM] Zone kernel: Available graphics memory: 16397326 KiB | |
Dec 26 18:36:31 amit kernel: [ 4.644532] [TTM] Zone dma32: Available graphics memory: 2097152 KiB | |
Dec 26 18:36:31 amit kernel: [ 4.644539] nouveau 0000:2d:00.0: DRM: VRAM: 2048 MiB | |
Dec 26 18:36:31 amit kernel: [ 4.644541] nouveau 0000:2d:00.0: DRM: GART: 1048576 MiB | |
Dec 26 18:36:31 amit kernel: [ 4.644544] nouveau 0000:2d:00.0: DRM: TMDS table version 2.0 | |
Dec 26 18:36:31 amit kernel: [ 4.644545] nouveau 0000:2d:00.0: DRM: DCB version 4.0 | |
Dec 26 18:36:31 amit kernel: [ 4.644546] nouveau 0000:2d:00.0: DRM: DCB outp 00: 01000f02 00020030 |
1) BA::SkillName::Update preconditions when in merge flow when merge is broken is expected not to satisfy preconditions | |
Failure/Error: it { is_expected.not_to satisfy_preconditions.with_message(broken_merge_msg) } | |
#<BA::SkillName::Update skill_name: #<ReferencesOne #<SkillName id: 1001, created_at: nil, editor_c...>, skills: #<EmbedsMany []>, remaining_skills: #<EmbedsMany [#<BA::SkillName::Update::EmbededSkill vertica...]>, skill_name_id: 1001, name: "Skill 1", skill_page_slug: "corrin-blanda-1", selected_vertical: nil, new_name: "Skill 2", after_merge_confirmation: false> does not implement: broken_merge? |
# frozen_string_literal: true | |
class Ba::Book::Availability < Granite::Action::Precondition | |
description 'Must not be available to rent' | |
def call(**) | |
decline_with(:unavailable) unless book_available? | |
end | |
private |
# ba/skill_name/clone.rb | |
... | |
# precondition if: -> { in_merge_flow? } do | |
# decline_with(precondition_error('broken_merge')) if broken_merge? | |
# end | |
precondition MergeCapabilityCheck, if: -> { in_merge_flow? } | |
... | |
... |
def memstats | |
size = `ps -o size= #{$$}`.strip.to_i | |
"Size: #{size}" | |
end | |
# Source: https://www.rubytapas.com/2013/01/04/episode-042-streaming/ |
# https://www.codewars.com/kata/52f787eb172a8b4ae1000a34/train/ruby | |
# Number of trailing zeros of N! | |
def zeros(n) | |
(1..n).inject(1) {|fact, num| fact * num }.to_s.count('0') | |
end |