Skip to content

Instantly share code, notes, and snippets.

@capitalsav
capitalsav / .bashrc
Created Aug 31, 2020
My configuration for .bashrc
View .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"
}
View alphabet_symmetry.rb
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 / Gemfile
Created Jan 23, 2019
Activerecord without rails example
View Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'activerecord'
gem 'mysql2'