- instllation svg file
app/assets/images/svg/icon-filename.svg
- edit svg file
add attribute id
for svg tag
import { model as Model } from "@coderline/alphatab"; | |
import { match, P } from "ts-pattern"; | |
export const exportTex = (score: Model.Score) => { | |
let result = ""; | |
const [tracks, metaData] = compileScore(score); | |
result += metaData; | |
result += tracks | |
.map((track) => { | |
let result = ""; | |
const [staves, metaData] = compileTrack(track); |
# frozen_string_literal: true | |
RSpec.shared_examples 'respond_with' do |http_status, openapi: false| | |
# openapi | |
openapi = { summary: metadata[:example_group][:parent_example_group][:parent_example_group][:description] } if openapi | |
describe '', openapi: openapi do | |
let(:id) do | |
super() | |
rescue StandardError | |
nil |
// https://www.youtube.com/watch?v=:ID | |
// https://www.youtube.com/channel/:ID | |
const getIDfromYoutubeURL = (url: string): string | null => { | |
const newURL = new URL(url); | |
const { pathname } = newURL; | |
if (pathname.includes("watch")) return newURL.searchParams.get("v"); | |
if (pathname.includes("channel")) return pathname.split("/")[2]; | |
return null; | |
}; |
// http://example.com/:ID | |
const getIDfromURL = (url: string): string => | |
new URL(url).pathname.replace(/\//g, ""); | |
export default getIDfromURL; |
class CreateUserRelationships < ActiveRecord::Migration[5.2] | |
def change | |
create_table :user_relationships do |t| | |
t.references :follower, foreign_key: { to_table: :users } | |
t.references :followed, foreign_key: { to_table: :users } | |
t.timestamps | |
t.index [:follower_id, :followed_id], unique: true | |
end |
import React, { ChangeEvent } from "react"; | |
import { | |
Control, | |
DeepMap, | |
FieldError, | |
FieldValues, | |
RegisterOptions, | |
useController, | |
} from "react-hook-form"; | |
import { ErrorMessage } from "@hookform/error-message"; |