I hereby claim:
- I am cutalion on github.
- I am cutalion (https://keybase.io/cutalion) on keybase.
- I have a public key ASCxHyC7j9qjGEbi58EVnguJc8s-TwbR9YLfegmqtwWXjAo
To claim this, I am signing this object:
use std::fmt; | |
// Define the dimensions of the game board | |
const ROWS: usize = 20; | |
const COLS: usize = 20; | |
// Define the Cell struct | |
#[derive(Clone, Copy)] | |
struct Cell(bool); |
I hereby claim:
To claim this, I am signing this object:
# override original exist? so that it does not use COUNT() | |
def exist?(*args, &block) | |
sql = where(*args, &block).dataset.unordered.select(1).exists | |
db.select(sql.as(:exists)).first[:exists] | |
end | |
alias any? exist? | |
private | |
def db |
# frozen_string_literal: true | |
require 'securerandom' | |
LETTERS = ('a'..'z').to_a.freeze | |
BIG_LETTERS = ('A'..'Z').to_a.freeze | |
DIGITS = ('0'..'9').to_a.freeze | |
SPECIAL = '~`!@#$%^&*()_+{}][;:\'"/?>.<,'.split.freeze | |
ALL = (LETTERS + BIG_LETTERS + DIGITS + SPECIAL).freeze |
require 'pry' | |
# A | |
# |- B | |
# | |- D | |
# | | |
# |- C | |
AppError = Class.new(StandardError) | |
Error1 = Class.new(AppError) |
module Initializer | |
def initialize | |
puts 'Initializer#initialize' | |
super | |
end | |
end | |
class Klass | |
prepend Initializer |
# Пусть админы могут удалять комментарии | |
# и мы уведомляем кого-нибудь, что комментарий был удален | |
class DeleteComment | |
def call(comment) | |
transaction do | |
comment.delete! | |
user.decrement(:comments_count) | |
end |
source "https://rubygems.org" | |
gem 'sqlite3' | |
gem 'dry-logic' | |
gem 'dry-types' | |
gem 'rom' | |
gem 'rom-sql' | |
gem 'pry' |
I hereby claim:
To claim this, I am signing this object:
require 'rom' | |
require 'rom-repository' | |
require 'rom-sql' | |
require 'pry' | |
module Entity | |
end | |
config = ROM::Configuration.new(:sql, 'sqlite::memory') | |
conn = config.gateways[:default].connection |