Skip to content

Instantly share code, notes, and snippets.

@droznyk
droznyk / ruby-project-stats.rb
Created March 9, 2023 13:08 — forked from louismullie/ruby-project-stats.rb
Count the number of files, lines of code and comments in a Ruby project.
o = 0 # Number of files
n = 0 # Number of lines of code
m = 0 # Number of lines of comments
files = Dir.glob('/path/to/dir/**/*.rb')
files.each do |f|
next if FileTest.directory?(f)
o += 1
i = 0
lines = []
@droznyk
droznyk / mysql-docker.sh
Created July 24, 2020 13:08 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@droznyk
droznyk / css-selectors.md
Created June 9, 2020 08:20 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;