This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= form_for(board, html: {class: "space-y-4"}) do |form| %> | |
| <div> | |
| <%= form.label :title, class: "block text-sm font-medium text-gray-700" %> | |
| <%= form.text_field :title %> | |
| </div> | |
| <div> | |
| <%= form.fields_for :embeds do |embed_form| %> | |
| <%= embed_form.label :input, class: "sr-only" %> | |
| <%= embed_form.text_field :input, placeholder: "Enter an embeddable link", data: {reflex_permanent: true} %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'googleauth' | |
| require 'google/apis' | |
| require 'google/apis/calendar_v3' | |
| module GoogleMeetService | |
| def self.create_google_event(event) | |
| authorize_client | |
| google_event = create_calendar_event(event) | |
| updated_google_event = update_calendar_event(event,google_event) | |
| event.update_attribute(:conference_link,updated_google_event.hangout_link) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController < ActionController::Base | |
| protect_from_forgery with: :exception | |
| around_action :global_request_logging | |
| def global_request_logging | |
| http_request_header_keys = request.headers.env.keys.select{|header_name| header_name.match("^HTTP.*|^X-User.*")} | |
| http_request_headers = request.headers.env.select{|header_name, header_value| http_request_header_keys.index(header_name)} | |
| puts '*' * 40 | |
| pp request.method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- encoding : utf-8 -*- | |
| namespace :heroku do | |
| namespace :deploy do | |
| PRODUCTION_APP = 'nomedoprojeto-production' | |
| STAGING_APP = 'nomedoprojeto-staging' | |
| def run(*cmd) | |
| system(*cmd) | |
| raise "Command #{cmd.inspect} failed!" unless $?.success? | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- encoding : utf-8 -*- | |
| namespace :heroku do | |
| namespace :deploy do | |
| PRODUCTION_APP = 'nomedoprojeto-production' | |
| STAGING_APP = 'nomedoprojeto-staging' | |
| def run(*cmd) | |
| system(*cmd) | |
| raise "Command #{cmd.inspect} failed!" unless $?.success? | |
| end |