Skip to content

Instantly share code, notes, and snippets.

@romansklenar
romansklenar / .p10k.zsh
Created March 28, 2025 17:23
My powerlevel10k configuration
# Generated by Powerlevel10k configuration wizard on 2025-03-03 at 15:20 CET.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 49619.
# Wizard options: nerdfont-v3 + powerline, small icons, rainbow, unicode, 24h time,
# angled separators, sharp heads, flat tails, 2 lines, dotted, no frame, dark-ornaments,
# sparse, many icons, concise, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
# Type `p10k configure` to generate your own config based on it.
#
@romansklenar
romansklenar / tollers-sk.txt
Created December 15, 2023 22:41
List of tollers born in and imported to 🇸🇰
Abby's Ninja Cole z Jesenicke smecky
Abby's Ninja Jay z Jesenicke smecky
Alexa Cherubic Soul
Alfie Amadeus Cherubic Soul
Alice Tipota Red Fox
Aliya Cherubic Soul
Amalia Cherubic Soul
Amalka Tipota Red Fox
Amalka z Kotarskych luk
Amber Cherubic Soul
@romansklenar
romansklenar / gwi.puml
Created December 18, 2019 19:28
GWI puml definition
!define GWI_BG_COLOR #d4007b
!define GWI_BORDER_COLOR #abcdef
skinparam rectangle<<gwi_system>> {
StereotypeFontColor ELEMENT_FONT_COLOR
FontColor #ELEMENT_FONT_COLOR
BackgroundColor GWI_BG_COLOR
BorderColor GWI_BORDER_COLOR
}
@romansklenar
romansklenar / db.rake
Created April 1, 2015 18:08
Useful rake task for maintain PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc 'Maintains database by running command as ANALYZE, VACUUM and REINDEX'
task maintain: :environment do
verbose = ENV['VERBOSE'].present?
connection = ActiveRecord::Base.connection
puts "Maintaining database #{connection.current_database} ..."
connection.execute("VACUUM FULL #{'VERBOSE' if verbose}")
@romansklenar
romansklenar / devise.cs.yml
Last active August 29, 2015 14:08 — forked from jnv/devise.cs.yml
Czech translation for Devise 3.4
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
cs:
errors:
messages:
already_confirmed: 'byl již potvrzen, prosím, zkuste se přihlásit'
confirmation_period_expired: 'musí být potvrzen během %{period}, požádejte prosím o nový'
expired: 'vypršel, požádejte prosím o nový'
not_found: 'nenalezen'
not_locked: 'nebyl uzamčen'
@romansklenar
romansklenar / commands.sh
Created April 26, 2014 17:28
Rails 4.1 application update diff
rails _3.2.15_ new rails_update --database=postgresql --skip-bundle
rails _4.1.0_ new rails_update --database=postgresql --skip-bundle
class Player
def play_turn(warrior)
warrior.walk!
end
end
@romansklenar
romansklenar / crosstab.sql
Last active February 1, 2023 18:46
PostgreSQL "pivot table" example using tablefunc extension
CREATE EXTENSION tablefunc;
CREATE TABLE sales(year int, month int, qty int);
INSERT INTO sales VALUES(2007, 1, 1000);
INSERT INTO sales VALUES(2007, 2, 1500);
INSERT INTO sales VALUES(2007, 7, 500);
INSERT INTO sales VALUES(2007, 11, 1500);
INSERT INTO sales VALUES(2007, 12, 2000);
INSERT INTO sales VALUES(2008, 1, 1000);
INSERT INTO sales VALUES(2009, 5, 2500);
@romansklenar
romansklenar / 20131118172653_create_transactional_items_view.rb
Last active July 3, 2017 09:15
Using PostgreSQL's materialized views as background for ActiveRecord models for flexible statistics
# db/migrate/20131118172653_create_transactional_items_view.rb
class CreateTransactionalItemsView < ActiveRecord::Migration
def up
select_sql = File.open("#{Rails.root}/db/migrate/20131118172653_create_transactional_items_view.sql", 'r') { |f| f.read }
# for materialized view:
view_sql = "CREATE MATERIALIZED VIEW transactional_items AS (#{select_sql})"
# for normal view:
view_sql = "CREATE VIEW transactional_items AS (#{select_sql})"