Skip to content

Instantly share code, notes, and snippets.

View valdemarua's full-sized avatar

Volodymyr valdemarua

View GitHub Profile
@valdemarua
valdemarua / ar_migrate.rb
Created December 20, 2015 00:08 — forked from icyleaf/ar_migrate.rb
ActiveRecord type of integer (tinyint, smallint, mediumint, int, bigint)
# activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb
# Maps logical Rails types to MySQL-specific data types.
def type_to_sql(type, limit = nil, precision = nil, scale = nil)
return super unless type.to_s == 'integer'
case limit
when 1; 'tinyint'
when 2; 'smallint'
when 3; 'mediumint'
when nil, 4, 11; 'int(11)' # compatibility with MySQL default
@valdemarua
valdemarua / ohmyzsh-dropbox-sync.sh
Last active January 5, 2022 04:55 — forked from robbyrussell/ohmyzsh-dropbox-sync.sh
Keep your @ohmyzsh ~/.zshrc in sync via dropbox
#
# RUN JUST ONCE
#
# Add a new directory in your Dropbox (or use an existing one)
mkdir -p ~/Dropbox/dotfiles
# move existing file to Dropbox
mv ~/.zshrc ~/Dropbox/dotfiles/zshrc
# oh-my-zsh