Skip to content

Instantly share code, notes, and snippets.

@bpohoriletz
bpohoriletz / install_meslo_wsl.sh
Created May 17, 2023 13:29 — forked from romkatv/install_meslo_wsl.sh
Install Meslo Powerline font family on Windows
#!/bin/bash
#
# This script installs patched Meslo Powerline font family on Windows.
# The fonts are installed for the current user only. The script must be
# run from WSL.
#
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/romkatv/aa7a70fe656d8b655e3c324eb10f6a8b/raw/install_meslo_wsl.sh)"
#
# If you just want the font files, they are in
# https://github.com/romkatv/dotfiles-public/tree/master/.local/share/fonts/NerdFonts.
@bpohoriletz
bpohoriletz / rails_docker.sh
Last active December 23, 2022 20:09
Rails 7.0.1/Ruby 3.1/SQLite app in Docker
# set ruby/rails version
export DOCKER_RAILS_VERSION="7.0.1"
export DOCKER_RUBY_VERSION="3.1.0"
export RAILS_PROJECT_NAME="rails7"
# create folder for the project and add Gemfile with necessary rails version
mkdir "$RAILS_PROJECT_NAME"
cd "$RAILS_PROJECT_NAME"
echo "ruby '$DOCKER_RUBY_VERSION'
source 'https://rubygems.org'
gem 'rails', '$DOCKER_RAILS_VERSION'" > Gemfile
# Perform migrations
migrations = [CreateEventTableMigration, AddEventCreatedMigration]
ActiveRecord::Migrator.new(:up, migrations).migrate
# Inline bundler
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "sinatra", "2.0.5"
RUBY_THEORY
# Ruby variables - local, etc.
# What is the difference between Procs and Lambdas
# Duck typing. Pros cons?
# What is the value of nil.object_id in Ruby? Why?