Skip to content

Instantly share code, notes, and snippets.

View slakat's full-sized avatar
🎧

Katherine Páez Ramos slakat

🎧
View GitHub Profile

T13 Te Explica and Long Form pieces links where i worked

All these pieces were made between october and december, 2019

Date as MMDD

REPORTAJE/LONG FORM:


  • 1127 REPORTAJE/LONG FORM: Los coletazos econòmicos de la crisis Reportaje
/* Media Queries
-------------------------------------------------------------- */
@media only screen and (min-width: 1930px) {
}
/* Smaller than standard 1200 */
@media only screen and (max-width: 1199px) {
}
/* Smaller than standard 980 */
es:
date:
abbr_day_names:
- dom
- lun
- mar
- mié
- jue
- vie
- sáb
@slakat
slakat / registration.html.haml
Last active December 22, 2015 17:42
Sign up page with options to show password not encrypted. Fancy icons. Note: Bootstrap_form gem used.
.row.register-box
.signup.col-md-12
.row
.col-md-12
%h1 Sign up
.row
.col-md-12
%h4
Already have an account?
=link_to 'Log in', new_user_session_path
@slakat
slakat / polymorphic_association.rb
Created February 24, 2015 14:33
Polymorphic association in rails: create a table with the fields name_id (integer) and name_type (string), and later in the model use the belongs_to :name, polymorphic: true to assing all the work to that field and identify the right class for every entry.
class ServiceSchedule < ActiveRecord::Base
belongs_to :service_activity, polymorphic: true
end
class AcademicService < ActiveRecord::Base
has_many :service_schedules, as: :service_activity
end
class PartnerService < ActiveRecord::Base
has_many :service_schedules, as: :service_activity
@slakat
slakat / days_in_date_range.rb
Last active August 29, 2015 14:16
Find all the dates for a weekday in a date range
WEEK={"Lunes"=> 1,"Martes" => 2, "Miércoles" => 3, "Jueves" => 4, "Viernes" => 5}
def repeating_events(day)
start_date = self.start_time.to_date # your start
end_date = self.end_time.to_date # your end
my_days = [WEEK[day]] # day of the week in 0-6. Sunday is day-of-week 0; Saturday is day-of-week 6.
return (start_date..end_date).to_a.select {|k| my_days.include?(k.wday)}
end