Skip to content

Instantly share code, notes, and snippets.

@EmilioColds
EmilioColds / matching-email-tutorial.md
Created April 29, 2024 21:03
Regex Tutorial for Matching an Email by Emilio Frías

Regex Tutorial for Matching an Email

For my first tutorial, the objective is to summarize the syntax and the different components that create a regex. For this tutorial, the regex example will be one that seeks to macth an email address. We will find out how this regex create a pattern, seeking to match any real life email address.

Summary

The regex that will be explained is the following:

/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
@YSakhno
YSakhno / .gitattributes
Created April 29, 2024 21:03
Latest custom settings for new Kotlin projects (built with Gradle)
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf
@edsqjr
edsqjr / gist:c3d2669d7ed1e594a6e22565a9c3b8e1
Created April 29, 2024 21:03
Install php + composer on Ubuntu 22.04 LTS
# install php 8.1 from package
sudo apt-get install php8.1
# install composer from script
wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet
# set "composer" as a command shell
sudo mv composer.phar /usr/local/bin/composer
# check needed dependencies
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created April 29, 2024 21:03
Rimworld output log published using HugsLib
Log uploaded on Monday, April 29, 2024, 2:03:22 PM
Loaded mods:
Harmony(brrainz.harmony): 0Harmony(2.3.3), HarmonyMod(2.3.1)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib): 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.3)
Character Editor(void.charactereditor): CharacterEditor(1.5.9)
1-2-3 Personalities M1(hahkethomemah.simplepersonalities): SP_Module1(0.0.0)
Maintainers:
evanjs: hydrus, hydrus, hydrus, hydrus
dali99: hydrus, hydrus, hydrus, hydrus
aarch64-linux hydrus
x86_64-linux hydrus
aarch64-darwin hydrus
x86_64-darwin hydrus
time="2024-04-29T20:59:12Z" level=error msg="unable to parse all the rules for ruleset" error="unable to find ruleset.yaml\nunable to find ruleset.yaml\nunable to find ruleset.yaml" file=/opt/input/rules/
time="2024-04-29T20:59:41Z" level=info msg="provider does not have dependency capability" provider=builtin
time="2024-04-29T20:59:42Z" level=info msg="info rule not matched" rule=embedded-cache-libraries-01000
time="2024-04-29T20:59:42Z" level=info msg="info rule not matched" rule=embedded-cache-libraries-02000
time="2024-04-29T20:59:42Z" level=info msg="info rule not matched" rule=embedded-cache-libraries-03000
time="2024-04-29T20:59:43Z" level=info msg="info rule not matched" rule=embedded-cache-libraries-04000
time="2024-04-29T20:59:43Z" level=info msg="info rule not matched" rule=embedded-cache-libraries-05000
time="2024-04-29T20:59:43Z" level=info msg="info rule not matched" rule=embedded-cache-libraries-06000
time="2024-04-29T20:59:44Z" level=info msg="info rule not matched" rule=embedded-cache-librari
/**
* @file
* Fires Optimizely custom events when certain conditions are met.
* Knows which events to fire based on values in drupalSettings.optimizely_custom_events array which is populated in mb.module.
*
*/
(function () {
Drupal.behaviors.optimizely_custom_events = {
attach: function () {
@Avery2
Avery2 / filter.js
Created April 29, 2024 21:01
filter json for key or value that have term
function filterJSON(json, searchTerm) {
// Function to check if the key or value matches the search term
function isMatch(value) {
if (value === null || value === undefined) return false;
if (typeof value === 'symbol') return value.toString().includes(searchTerm.toLowerCase());
if (typeof value === 'object') return false; // Avoid stringifying complex objects here
return value.toString().toLowerCase().includes(searchTerm.toLowerCase());
}
// Recursive function to filter the JSON based on searchTerm

PR-18593 (Sha: d4b73ec1)

OS: Linux bctldroxie011.noam.lnrm.net (Linux 3.10.0-1160.114.2.el7.x86_64) Host: bctldroxie011.noam.lnrm.net GCC: gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) - Git: 1.8.3.1CMake: 3.18.0curl: 7.29.0node.js: v16.13.0npm: 8.1.0

Build error: Build log Build log