This file contains 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
new_line = "____________________________\n" | |
# Blocks | |
puts "Blocks" | |
my_numbers = [1, 2, 3, 4, 5] | |
my_numbers.each { | |
|number| | |
puts "Printing the number: #{number}" |
This file contains 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
[{"regionId":14676,"regionX":33,"regionY":36,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":38,"regionY":32,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":40,"regionY":36,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":38,"regionY":31,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":40,"regionY":27,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":33,"regionY":27,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":32,"regionY":27,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":27,"regionY":31,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":32,"regionY":36,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":27,"regionY":32,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":25,"regionY":36,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":25,"regionY":27,"z":1,"color":"#9C7C7C7C"},{"regionId":14676,"regionX":29,"regionY":23,"z":1,"color":"#9C7C7C7C","label":"attack"},{"regionId":14676,"regionX":25,"regionY":29,"z":1,"color":"#9C7C7C7C","label":"atta |
This file contains 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
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elastic.gpg | |
echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list | |
sudo apt update | |
sudo apt install elasticsearch | |
# You'll need to edit this one twice, once to set the host and port, and once to set xpack security to false. | |
sudo nano /etc/elasticsearch/elasticsearch.yml | |
sudo nano /etc/wsl.conf | |
sudo systemctl start elasticsearch |
This file contains 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
import { useState, useEffect } from 'react'; | |
import { createPicker } from 'picmo'; | |
function EmojiPicker() { | |
const [chosenEmoji, setChosenEmoji] = useState(''); | |
let emojiPicker; | |
useEffect(() => { | |
emojiPicker = document.querySelector('.pickerContainer'); | |
if (emojiPicker === null) { |
This file contains 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
import { Controller } from "@hotwired/stimulus"; | |
/** | |
* The data attribute containing the draggable element's id. | |
*/ | |
const dataResourceID = "data-resource-id"; | |
/** | |
* The data attribute containing the draggable element's outer parent, | |
* to prevent traversing up to the document root. | |
*/ |
This file contains 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
# frozen_string_literal: true | |
# All Devise controllers are inherited from here. | |
class DeviseController < Devise.parent_controller.constantize | |
include Devise::Controllers::ScopedViews | |
if respond_to?(:helper) | |
helper DeviseHelper | |
end | |
This file contains 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
# SIGN UP | |
uri = URI("https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=#{Rails.application.credentials.firebase_api_key}") | |
# LOGIN | |
uri = URI("https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=#{Rails.application.credentials.firebase_api_key}") |
This file contains 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
/* | |
* This is a manifest file that'll be compiled into application.css, which will include all the files | |
* listed below. | |
* | |
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's | |
* vendor/assets/stylesheets directory can be referenced here using a relative path. | |
* | |
* You're free to add application-wide styles to this file and they'll appear at the bottom of the | |
* compiled file so the styles you add here take precedence over styles defined in any other CSS | |
* files in this directory. Styles in this file should be added after the last require_* statement. |
This file contains 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
bundle add devise | |
bundle install | |
rails g devise:install | |
class TurboDeviseController < ApplicationController | |
class Responder < ActionController::Responder | |
def to_turbo_stream | |
controller.render(options.merge(formats: :html)) | |
rescue ActionView::MissingTemplate => error |
This file contains 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
<style scoped> | |
.sm-title { | |
font-size: 2.5rem; | |
font-weight: bold; | |
text-align: center; | |
font-family: "Roboto", sans-serif; | |
} | |
.container { | |
width: 90%; | |
margin: 0 auto; |
NewerOlder