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 { useForm } from "react-hook-form"; | |
| import { zodResolver } from "@hookform/resolvers/zod"; | |
| import * as z from "zod"; | |
| const schema = z.object({ | |
| email: z.string().email().min(2), | |
| password: z.string().min(6) | |
| }); | |
| export default function RhfFormWithZod() { |
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
| function formatDateRange(startDate, endDate) { | |
| const start = new Date(startDate); | |
| const end = new Date(endDate); | |
| const optionsSameYear = { year: 'numeric' }; | |
| const optionsSameMonth = { month: 'long', day: 'numeric' }; | |
| const optionsFull = { month: 'long', day: 'numeric', year: 'numeric' }; | |
| // Check if the start and end dates are the same | |
| if (start.getTime() === end.getTime()) { |
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 { useCallback, useEffect, useRef, useState } from "react"; | |
| interface UseBroadcastChannelOptions { | |
| name: string; | |
| onMessage?: (event: MessageEvent) => void; | |
| onMessageError?: (event: MessageEvent) => void; | |
| } | |
| interface UseBroadcastChannelReturn<D, P> { | |
| isSupported: boolean; |
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
| { | |
| collections(first: 10, sortKey: UPDATED_AT, reverse: true) { | |
| pageInfo { | |
| hasNextPage | |
| } | |
| edges { | |
| node { | |
| id | |
| title | |
| descriptionHtml |
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
| {% comment %} | |
| Do you have customized form fields on the product pages of your Shopify store? | |
| Shopify's order confirmation email does not automatically display the values the customer inputs. Here's how to includes them manually. | |
| 1. Go to Settings in the Shopify admin | |
| 2. Click Notifications | |
| 3. Click the link Order confirmation to open the template editor | |
| 4. Now copy and paste this code in the template right in the section where the order's line items are rendered. | |
| Look for a line that contains {{line.variant.title}}. You'll want to experiment with the code location. |
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
| <?php | |
| namespace WordFilter; | |
| /** | |
| * Plugin Name: Word Filter | |
| * Plugin URI: https://wordpress.com/word-filter | |
| * Description: MH Slider is a slider plugin | |
| * Version: 1.0.0 | |
| * Requires at least: 5.6 |
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
| <?php | |
| /** | |
| * Plugin Name: Our Test plugin | |
| * Plugin URI: https://wordpress.com/mh-slider | |
| * Description: A truly amazing plugin. | |
| * Version: 1.0.0 | |
| * Requires at least: 5.6 | |
| * Author: MH Raihan | |
| * Author URI: http://mhraihan.com |
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 gist is a part of the NestJS Zero to Hero course on Udemy. | |
| ### https://www.udemy.com/course/nestjs-zero-to-hero/?referralCode=F672C0C701844DC91F4D | |
| To run PostgreSQL on Docker, run the following in your Terminal: | |
| docker run --name postgres-nest -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres |
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
| {%- capture contentForQuerystring -%}{{ content_for_header }}{%- endcapture -%} | |
| {% comment %} Use string splitting to pull the value from content_for_header and apply some string clean up {% endcomment %} | |
| {%- assign pageUrl = contentForQuerystring | split:'"pageurl":"' | last | split:'"' | first | split:'.myshopify.com' | last | | |
| replace:'\/','/' | | |
| replace:'%20',' ' | | |
| replace:'\u0026','&' | |
| -%} | |
| {%- assign pageQuerystring = pageUrl | split:'?' | last -%} |
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
| $(function() { | |
| var currentAjaxRequest = null; | |
| var searchForms = $('form[action="/search"]').css('position', 'relative').each(function() { | |
| var input = $(this).find('input[name="q"]'); | |
| input.attr('autocomplete', 'off').bind('keyup change', function() { | |
| var term = $(this).val(); | |
| var form = $(this).closest('form'); | |
| var searchURL = '/search?type=product&q=*' + term + '*'; | |
| var resultsList = $('.search-results'); | |
| resultsList.perfectScrollbar({ |
NewerOlder