This file contains 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
class RegX { | |
static final RegExp _emailRegExp = RegExp( | |
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9\-\_]+(\.[a-zA-Z]+)*$"); | |
static final RegExp _nonDigitsExp = RegExp(r'[^\d]'); | |
static final RegExp _anyLetter = RegExp(r'[A-Za-z]'); | |
static final RegExp _phoneRegExp = RegExp(r'^\d{7,15}$'); | |
static final RegExp _ipv4RegExp = RegExp( | |
r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'); | |
static final RegExp _ipv6RegExp = RegExp( | |
r'^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[ |
This file contains 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
Show hidden characters
// by ResoCoder | |
// https://github.com/rrousselGit/freezed/issues/85#issuecomment-593908291 | |
{ | |
"Part statement": { | |
"prefix": "pts", | |
"body": [ | |
"part '${TM_FILENAME_BASE}.g.dart';", | |
], | |
"description": "Creates a filled-in part statement" | |
}, |
This file contains 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
#right-sidebar { | |
position: -webkit-sticky; | |
position: sticky; | |
top: 0; | |
} | |
.site-header, .inside-article,.sidebar .widget, .comments-area, .paging-navigation, .my-ad, .wp-block-image { | |
-webkit-box-shadow: 5px 5px 30px -10px rgba(46,46,46,0.5); | |
-moz-box-shadow: 5px 5px 30px -10px rgba(46,46,46,0.5); |
This file contains 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 | |
//-------------------------------------------------------------- | |
//-------------------------------------------------------------- | |
//---------COPY CODE BELOW THIS LINE---------------------------- | |
//Adding adsense ad unit inside the article | |
//Insert ads after every third paragraph of single post content. |
This file contains 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 | |
//adding adsense ad unit inside the article | |
//Insert ads after second paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
$ad_code1 = '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
This file contains 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
//adding adsense ad unit inside the article | |
//Insert ads after second paragraph of single post content. | |
add_filter( 'the_content', 'prefix_insert_post_ads' ); | |
function prefix_insert_post_ads( $content ) { | |
$ad_code1 = '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<!-- inContent --> |
This file contains 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
# Set page cache expiration time to 10 minutes | |
Header set Cache-Control "max-age=600, must-revalidate" "expr=%{REQUEST_URI} !~ m#^/wp-admin#" |
This file contains 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
// Stop CF edge from caching your site when specific wordpress cookies are present | |
// script found in https://www.mmaton.com/2018/07/02/cloudflare-cache-anonymous-requests/ | |
addEventListener('fetch', event => { | |
event.respondWith(noCacheOnCookie(event.request)) | |
}) | |
async function noCacheOnCookie(request) { | |
// Determine which group this request is in. | |
const cookie = request.headers.get('Cookie') |
This file contains 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
// Sets Access-Control-Allow-Origin for fonts | |
// this worker should be used in subdomain from where fonts are being loaded but not in main site | |
// eg. www.example.com & static.example.com | |
// use this worker script with static.example.com | |
let corsHeaders = { | |
"Access-Control-Allow-Origin" : "https://sangams.com.np", | |
} | |
addEventListener('fetch', event => { |