Skip to content

Instantly share code, notes, and snippets.

@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active October 18, 2024 12:11
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@ZachJDev
ZachJDev / action.yml
Last active October 13, 2023 12:58
Example GH action to deploy only changed functions to Firebase
name: example action
on:
push:
branches: [ dev ]
pull_request:
branches: [ master ]
jobs:
import { writable } from "svelte/store";
import { browser } from "$app/environment";
//string
export const userName = writable(
(browser && localStorage.getItem("userName")) || "hello world"
);
userName.subscribe((val) => browser && (localStorage.userName = val));
// array
@pom421
pom421 / form-next-ts-rhf-zod-demo.tsx
Last active December 22, 2023 16:28
Form with React Hook form and zod rules (Next.js page example)
// try it : https://codesandbox.io/s/sample-next-ts-rhf-zod-9ieev
import React from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import type { FieldError } from "react-hook-form";
// JSON.stringify(error) will not work, because of circulare structure. So we need this helper.
@ciiqr
ciiqr / dispatch.sh
Last active October 9, 2024 14:38
github actions, repository_dispatch with client_payload
# TODO: replace :token, :user, and :repo
curl -H "Authorization: token :token" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/:user/:repo/dispatches" \
-d '{"event_type": "awesomeness", "client_payload": {"foo": "bar"}}'
@mikepruett3
mikepruett3 / shell-setup.ps1
Last active October 16, 2024 21:56
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@dikiaap
dikiaap / git-io-custom-url.md
Last active June 19, 2024 01:26
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@tkh44
tkh44 / index.js
Created August 25, 2017 19:25
Getting react-leaflet working with SSR (next.js)
import React from 'react'
export default class extends React.Component {
constructor () {
super()
this.state = { components: undefined }
this.markers = new WeakMap()
}
componentDidMount () {
@zkat
zkat / index.js
Last active September 26, 2024 10:33
npx is cool
#!/usr/bin/env node
console.log('yay gist')