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
| SELECT | |
| first_name | |
| FROM | |
| users | |
| LEFT JOIN messages received_messages ON received_messages.from_id = 1 | |
| AND received_messages.to_id = users.id | |
| LEFT JOIN messages sent_messages ON sent_messages.from_id = users.id | |
| AND sent_messages.to_id = 1 | |
| WHERE | |
| received_messages.id IS NOT NULL |
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
| .rainbow { | |
| -webkit-background-clip: text; | |
| -moz-background-clip: text; | |
| background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| -moz-text-fill-color: transparent; | |
| text-fill-color: transparent; | |
| background-size: 100%; | |
| background-image: linear-gradient( | |
| 90deg, |
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
| = javascript_tag nonce: true do | |
| ' (function() { | |
| ' const images = [...document.querySelectorAll("img")]; | |
| ' let count = 0; | |
| ' | |
| ' const ready = () => { | |
| ' const div = document.createElement("div"); | |
| ' div.id = "HCTIReadyNow"; | |
| ' document.body.appendChild(div); | |
| ' }; |
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
| { | |
| en: { | |
| i18n: { | |
| plural: { | |
| keys: [:one, :other], | |
| rule: lambda do |n| | |
| if n == 1 | |
| :one | |
| else | |
| :other |
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
| #!/usr/bin/env ruby | |
| # frozen_string_literal: true | |
| require "yaml" | |
| if ARGV.size != 2 | |
| puts "USAGE: yaml-merge file_1.yml file_2.yml" | |
| exit | |
| 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
| const SUBJECT_LINE_EN = "So, what do you think?" | |
| const SUBJECT_LINE_FR = "Alors, t'en penses quoi ?" | |
| const FROM = "dorian@socializus.app" | |
| const NAME = "Dorian" | |
| const FIRST_NAME_COLUMN = "first_name" | |
| const EMAIL_COLUMN = "email" | |
| const LOCALE_COLUMN = "locale" | |
| const SENT_COLUMN = "sent" | |
| function onOpen() { |
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
| #!/bin/bash | |
| set -e | |
| echo "> Removing certificate" | |
| sudo security delete-certificate -c localhost || true | |
| echo "> Generating .key" | |
| sudo openssl genrsa -out config/localhost.key 4096 |
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 "bundler/inline" | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "rails" | |
| gem "sqlite3" | |
| end | |
| require "active_record" | |
| require "logger" |
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
| { | |
| inputs: | |
| [params[:authenticity_token], request.x_csrf_token].map do |token| | |
| Base64.urlsafe_decode64(token) | |
| end.map do |token| | |
| xor_byte_strings( | |
| token[0...AUTHENTICITY_TOKEN_LENGTH], | |
| token[AUTHENTICITY_TOKEN_LENGTH..-1] | |
| ) | |
| 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
| module RenderJpgConcern | |
| MIN_WIDTH = 20 | |
| MAX_WIDTH = 1000 | |
| MIN_HEIGHT = 20 | |
| MAX_HEIGHT = 1000 | |
| DEFAULT_WIDTH = 400 | |
| DEFAULT_HEIGHT = 300 | |
| def render_jpg(model) | |
| http_cache_forever(public: true) do |