Skip to content

Instantly share code, notes, and snippets.

View 6220119's full-sized avatar
🌴

Nguyen Vu Cuong (Ralph) 6220119

🌴
View GitHub Profile
@6220119
6220119 / Bookmarklet: force google translate work everywhere
Last active January 26, 2024 05:01
Bookmarklet: force google translate work everywhere
javascript:[...document.querySelectorAll('.notranslate')].forEach(n => n.classList.remove('notranslate'))
@6220119
6220119 / outbound-email-with-cloudflare.md
Created November 13, 2023 05:36 — forked from irazasyed/outbound-email-with-cloudflare.md
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

@6220119
6220119 / explainer.md
Created October 11, 2023 23:58 — forked from xiaochengh/explainer.md
Explainer: Font Metrics Override Descriptors

Explainer: Font Metrics Override Descriptors

** Not standardized yet!! **

Spec

This doc explains descriptors ascent-override, descent-override, line-gap-override and advance-override for CSS @font-face rule.

Usage:

@6220119
6220119 / p4merge4git.md
Created August 15, 2023 12:06 — forked from tony4d/p4merge4git.md
Setup p4merge as a visual diff and merge tool for git
@6220119
6220119 / regex_html_tag.md
Created June 10, 2023 00:08 — forked from gavin-asay/regex_html_tag.md
Regex and You: Matching an HTML Tag

Regex and You: Matching an HTML Tag

Regular expressions, ever versatile, will help up locate HTML tags in a string today.

Summary

Pattern matching HTML strings serves at least one crucial function in web dev: sanitizing user input. Allowing user-submitted strings opens one's application to significant vulnerability. Supposing, for example, some ne'er-do-well on the internet submitted a comment that includes <script src="[path]/stealYourData.js"></script>. Regular expressions allow us to match HTML tags in a string, because HTML tags conform to a certain pattern:

  • begin and end with brackets (<>)
  • contain a string name consisting of one or more lowercase letters, like p, a, div, strong, script
# Usage:
# cd Downloads
# sh extract-vsix.sh mvllow.rose-pine-0.3.5
# ^ do not include .vsix
path="$1"
name="$(basename -- $1)"
out_dir=~/.vscode/extensions
tmp_dir=$(mktemp -d -t mvllow-dots)
@6220119
6220119 / ChatGPT Stable Diffusion prompts generator.txt
Created April 26, 2023 08:13 — forked from bluelovers/ChatGPT Stable Diffusion prompts generator.txt
using ChatGPT as Stable Diffusion prompts generator
Stable Diffusion is an AI art generation model similar to DALLE-2.
Here are some prompts for generating art with Stable Diffusion.
Example:
- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, intricate, highly detailed, smooth, artstation, digital illustration
- pirate, concept art, deep focus, fantasy, intricate, highly detailed, digital painting, artstation, matte, sharp focus, illustration
- ghost inside a hunted room, art by lois van baarle and loish and ross tran and rossdraws and sam yang and samdoesarts and artgerm, digital art, highly detailed, intricate, sharp focus, Trending on Artstation HQ, deviantart, unreal engine 5, 4K UHD image
- red dead redemption 2, cinematic view, epic sky, detailed, concept art, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful, trending on artstation
- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting unreal 5 daz.
@6220119
6220119 / ColoredShadow.kt
Created December 30, 2022 09:13 — forked from cedrickring/ColoredShadow.kt
Draw a colored shadow in Android Jetpack Compose
/*
Copyright 2020 Cedric Kring.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
import {camelCase, kebabCase, lowerCase, snakeCase, startCase, upperCase, upperFirst} from 'lodash';
export default class StringUtility {
static toCamelCase(str) {
return camelCase(str);
}
static toTitleCase(str) {
return startCase(camelCase(str));