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
class UsersController < ApplicationController | |
before_action :set_user, only: [:show, :update, :destroy] | |
# GET /users | |
def index | |
@users = User.all | |
render json: @users | |
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
// | |
// AppleSignIn.swift | |
// | |
import Foundation | |
import FirebaseAuth | |
import AuthenticationServices | |
import CryptoKit | |
final class AppleSignIn: NSObject { |
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 Foundation | |
func solve(_ numRows: Int, _ result: [[Int]]?) -> [[Int]] { | |
guard numRows > 0 else { | |
return [] | |
} | |
var tmp = [[Int]]() | |
var tmpIndex = 0 | |
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"; | |
import { createPopper } from "@popperjs/core"; | |
// Connects to data-controller="popper" | |
export default class extends Controller { | |
static targets = ["element", "tooltip"]; | |
static values = { | |
placement: { type: String, default: "top" }, | |
offset: { type: Array, default: [0, 8] }, | |
}; |
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
#tooltip { | |
background: #333; | |
color: white; | |
font-weight: bold; | |
padding: 4px 8px; | |
font-size: 13px; | |
border-radius: 4px; | |
display: none; | |
} | |
#arrow, |
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
<section class="bg-gray-100 h-full w-full"> | |
<div class="container mx-auto px-2 md:px-4 py-4"> | |
<div class="flex justify-center items-center h-full md:h-screen"> | |
<div class="flex flex-col p-5 border border-gray-500 bg-white shadow-xl rounded-xl w-96 h-96 items-center justify-center"> | |
<h2>Button with popper</h2> | |
<div data-controller="popper"> | |
<button id="button" data-popper-target="element" data-action="mouseenter->popper#show mouseleave->popper#hide" class="bg-blue-500 text-blue-100 px-3 py-2 rounded-xl"> | |
Over me! | |
<div id="tooltip" role="tooltip" data-popper-target="tooltip"> | |
My tooltip |