➜ cat ~/.gnupg/gpg-agent.conf
pinentry-program /opt/homebrew/bin/pinentry-touchid
➜ ✗ cat ~/.config/gopass/gopass_wrapper.sh
➜ cat ~/.gnupg/gpg-agent.conf
pinentry-program /opt/homebrew/bin/pinentry-touchid
➜ ✗ cat ~/.config/gopass/gopass_wrapper.sh
# Add to `spec/support/database_state_loader.rb` | |
class DatabaseStateLoader | |
class EnvironmentError < RuntimeError; end | |
def self.load(path) | |
new(path).load | |
end | |
def initialize(path) |
# rails console test | |
# # or | |
# RAILS_ENV=test rails console | |
require 'capybara/dsl' | |
Capybara.app = app.instance_variable_get("@app") | |
cap = Object.new.instance_eval { extend Capybara::DSL; self } | |
# cap.visit '/' | |
# cap.page.find 'h1' |
####################### | |
## BUILD BASE | |
# Small image | |
FROM alpine:3.5 | |
# or | |
FROM ubuntu:16.04 | |
# LTS |
mkdir <dir>
git init .
git fetch --no-tags --force --progress -- https://github.com/<org>/<repo>.git +refs/heads/<branch>:refs/remotes/origin/<branch>
git config remote.origin.url https://github.com/<org>/<repo>.git
git config --add remote.origin.fetch +refs/heads/<branch>:refs/remotes/origin/<branch>
git config core.sparsecheckout
git checkout -f <sha>
#include <stdio.h> | |
#include <stdlib.h> | |
struct ListNode { | |
int val; | |
struct ListNode *next; | |
}; | |
struct ListNode* createNodeList(int arr[], int numSize); | |
struct ListNode* removeNthFromEnd(struct ListNode* head, int n); |
Authentication: I am who I say I am | |
Authorization: What am I allowed to do? |
class Category < Taxonomy | |
def self.sti_name | |
"category" | |
end | |
end |
I'm using dry-rb
and dry-struct
. And I wanted make some attributes optional, but I was confused with optional
.
So the thing is, you can't use optional
for skipping attributes. Optional means you can pass nil values, that's all.
So if you want to skip attributes, use this attribute by calling attribute?
class User < Dry::Struct
attribute :name, Types::String
attribute? :age, Types::Integer
So in Postgres you can create partial indexes with condition.
Let's say you have soft deletion in you table and you don't want them to be indexed.
You added deleted_at column, but forget change unique indexes. To find those tables manually will be a bit longer.
Here is SQL query which will help you find them faster:
SELECT tables.table_name
FROM information_schema.tables as tables
INNER JOIN (