Skip to content

Instantly share code, notes, and snippets.

@capitalsav
capitalsav / Gemfile
Created January 23, 2019 22:26
Activerecord without rails example
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'activerecord'
gem 'mysql2'
def solve(arr)
alphabet = ('a'..'z').to_a
result = []
arr.each do |word|
count = 0
word.split('').each_with_index do |letter, index|
count +=1 if alphabet.find_index(letter.downcase) == index
end
result.push(count)
end
@capitalsav
capitalsav / .bashrc
Created August 31, 2020 10:23
My configuration for .bashrc
# Alias git status
alias gs="git status"
# Alias git add .
alias ga="git add ."
# Function for git commit (instead of alias)
gc() {
git commit -m "$1"
}