Skip to content

Instantly share code, notes, and snippets.

View fabianvelizok's full-sized avatar
🎯
Focusing

Fabian Veliz fabianvelizok

🎯
Focusing
View GitHub Profile
# Option 1
pharmacies = []
Pharmacy.all.each do |pharmacy|
if pharmacy.recurrent_days.present?
recurrent_days = pharmacy.recurrent_days.split(',').map { |day| day.to_i }
pharmacies << pharmacy if recurrent_days.include?(Time.now.wday)
end
end
/**
*
* Gulpfile setup
*
* @since 1.0.0
* @author Veliz Fabián Horacio
* @package rhuoee
*/
'use strict';
@fabianvelizok
fabianvelizok / gist:c929c8edaa3a4d6a5873
Last active February 27, 2024 22:34
devise views to slim
rails generate devise:views
gem install html2slim
for file in app/views/devise/**/*.erb; do erb2slim $file ${file%erb}slim && rm $file; done
Get the Heroku db as detailed here:
heroku pgbackups:capture --expire --remote your_remote_repository
curl -o latest.dump `heroku pgbackups:url --remote your_remote_repository`
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U user -d database latest.dump
rm latest.dump
class CreateTweets < ActiveRecord::Migration
def change
create_table :tweets do |t|
t.attachment :image
t.text :body
t.belongs_to :user, index: true
t.timestamps
end