Skip to content

Instantly share code, notes, and snippets.

View rolandfarkasCOM's full-sized avatar
👋
Hey! Want to work together? Get in touch!

Roland Farkas rolandfarkasCOM

👋
Hey! Want to work together? Get in touch!
View GitHub Profile
@rolandfarkasCOM
rolandfarkasCOM / uk-number-plate-validation.md
Created January 15, 2024 13:43 — forked from danielrbradley/uk-number-plate-validation.md
Regular Expression to Validate UK Number Plates

Regular Expression to Validate UK Number Plates

Regular Expression

(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)|(?<DiplomaticPlate>^[0-9]{3}[DX]{1}[0-9]{3}$)

For use in JavaScript (with named groups removed):

(^[A-Z]{2}[0-9]{2}\s?[A-Z]{3}$)|(^[A-Z][0-9]{1,3}[A-Z]{3}$)|(^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(^[0-9]{1,4}[A-Z]{1,2}$)|(^[0-9]{1,3}[A-Z]{1,3}$)|(^[A-Z]{1,2}[0-9]{1,4}$)|(^[A-Z]{1,3}[0-9]{1,3}$)|(^[A-Z]{1,3}[0-9]{1,4}$)|(^[0-9]{3}[DX]{1}[0-9]{3}$)
@rolandfarkasCOM
rolandfarkasCOM / gist:faec6a1e3fda1d397fe45de2907496c2
Created December 11, 2023 17:23
Elementor / WordPress / HTML Web Page Remove Horizontal White Space
body {
width:100%;
overflow-x:hidden;
}
@rolandfarkasCOM
rolandfarkasCOM / PHP UUID Class
Created April 1, 2023 01:38
A class to return UUID on UNIX systems in php
class UUID {
public static function new() {
return file_get_contents('/proc/sys/kernel/random/uuid');
}
}
@rolandfarkasCOM
rolandfarkasCOM / Facebook Chat SDK Script
Created February 17, 2023 20:28
Replace {INSERTPAGEIDHERE} with your FB page id.
<script>
var chatbox = document.getElementById('fb-customer-chat');
chatbox.setAttribute("page_id", "{INSERTPAGEIDHERE}");
chatbox.setAttribute("attribution", "biz_inbox");
</script>
<!-- Your SDK code -->
<script>
window.fbAsyncInit = function() {
FB.init({
{
"cookies": {
"_ga": {
"value": "$IF(LINKER_PARAM(_gl, _ga),GA1.0.LINKER_PARAM(_gl, _ga),)"
}
},
"linkers": {
"_gl": {
"enabled": true,
"ids": {
<amp-analytics type="googleanalytics" config="/ga4.json" data-credentials="include">
<script type="application/json">
{
"vars": {
"GA4_MEASUREMENT_ID": "G-ROLANDF",
"GA4_ENDPOINT_HOSTNAME": "www.google-analytics.com",
"DEFAULT_PAGEVIEW_ENABLED": true,
"GOOGLE_CONSENT_ENABLED": false,
"WEBVITALS_TRACKING": false,
"PERFORMANCE_TIMING_TRACKING": false
@rolandfarkasCOM
rolandfarkasCOM / typeformparams.js
Created March 1, 2022 10:26
JS - Typeform - Pass UTM & Click ID (Google, Facebook, Microsoft) to Iframe
!function (window, document, undefined) {
document.addEventListener('DOMContentLoaded', function() {
var urlParams;
var parser = document.createElement('a');
var pattern = /utm_|gclid|fbclid|msclkid/i;
parser.href = window.location.href.replace('%20#', '?').toLowerCase();
if (pattern.test(parser.href)) { // url contains utms
var utms = window
.location
@rolandfarkasCOM
rolandfarkasCOM / amp-responsive-image-preload-link-srcset-opt-in.php
Created February 25, 2022 21:08 — forked from westonruter/amp-responsive-image-preload-link-srcset-opt-in.php
Enable preload links for responsive hero images which have srcset and sizes attributes. This is disabled by default because only Chrome supports imagesrcset and imagesizes on preload links. This eliminates the Optimizer from raising this notice: CannotPreloadImage: Not preloading the hero image because of the presence of a srcset attribute…
@rolandfarkasCOM
rolandfarkasCOM / Install Composer to use MAMP's PHP.md
Created October 21, 2021 19:47 — forked from kkirsche/Install Composer to use MAMP's PHP.md
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@rolandfarkasCOM
rolandfarkasCOM / Freelance
Created April 2, 2021 13:10
Freelance Demo Asset
👋 Hi, I’m a freelance developer
👀 I’m interested in open source, php, amp, nginx, secuirty and pretty much everything digital!
🌱 I never stop learning!
💞️ I’m looking to collaborate on open source projects!