Skip to content

Instantly share code, notes, and snippets.

View rbmrclo's full-sized avatar
Coffee 👨‍💻Code 🍸Cocktails

Robbie Marcelo rbmrclo

Coffee 👨‍💻Code 🍸Cocktails
View GitHub Profile
@rbmrclo
rbmrclo / gist:6162467
Created August 6, 2013 06:17
Postgresql remove string limit of 255 chars
# in rails application.rb
initializer "postgresql.no_default_string_limit" do
ActiveSupport.on_load(:active_record) do
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:string].delete(:limit)
end
end
@rbmrclo
rbmrclo / gist:5900017
Last active October 18, 2019 15:43
Create a gemset per project
# I'm not using this anymore
#
# Assuming that you are already on your project directory.
# Step 1: rvm gemset create [name of gemset]
# Step 2: rvm --rvmrc [ruby version here]@[name of gemset] # Note: You can check your current ruby version by running "ruby -v" from your console.
# Step 3: Refresh your directory, you can do this by simply checking out of your directory via command: cd.. and going back to that directory again.
# Step 4: RVM will ask you a simple Yes, No, View, Cancel question. Press Y for yes.
# Step 5: You're done! Run bundle install.
@rbmrclo
rbmrclo / Problem-1.php
Created November 16, 2012 11:52
Project Euler Solutions
/*
1.) If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
*/
// Solution in PHP, the simple way: