Skip to content

Instantly share code, notes, and snippets.

class StringValidator
ALLOWED_PARANTHESIS = {
')' => '(',
'}' => '{',
']' => '['
}.freeze
def initialize(value = '')
@text = value
end
@deepakmahakale
deepakmahakale / emoji_cheatsheet.md
Created December 4, 2016 18:42
GITHUB EMOJI CHEAT SHEET :octocat:

EMOJI CHEAT SHEET

People

:bowtie: :bowtie: 😄 :smile: :simple_smile: :simple_smile:
😆 :laughing: 😊 :blush: 😃 :smiley:
☺️ :relaxed: 😏 :smirk: 😍 :heart_eyes:
😘 :kissing_heart: 😚 :kissing_closed_eyes: 😳 :flushed:
@deepakmahakale
deepakmahakale / autopopulate_migrations.md
Last active December 1, 2016 21:08
Autopopulate migrations with proper command

If the migration name is of the form "AddXXXToYYY" or "RemoveXXXFromYYY" and is followed by a list of column names and types then a migration containing the appropriate add_column and remove_column statements will be created.

Creating a table

$ rails g migration CreateUsers email:string:index

db/migrate/20161201203703_create_users.rb

class CreateUsers < ActiveRecord::Migration