This file contains hidden or 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
// You can easily find out if the user is in the EU calculating the offset from GMT. | |
// It's not a perfect method but for simple use cases it works perfectly | |
// It also catches all Africa | |
const offset = new Date().getTimezoneOffset(); | |
// 0 is GMT and - 120 is Finland - | |
// It should catch all the EU - However it also catches most of Africa so use it carefully! |
This file contains hidden or 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
{ | |
"coord":{ | |
"lon":-122.42, | |
"lat":37.78 | |
}, | |
"weather":[ | |
{ | |
"id":701, | |
"main":"Mist", | |
"description":"mist", |
This file contains hidden or 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
<template> | |
<div> | |
<div class="spinner"> | |
<div class="cube1"></div> | |
<div class="cube2"></div> | |
</div> | |
<br /> | |
<div class='has-text-centered'> | |
<p class='subtitle' v-html='msg'></p> |
This file contains hidden or 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
# /start | |
def start_google(request): | |
"""first step Oauth2 to google analytics and get code""" | |
flow = OAuth2WebServerFlow(client_id = settings.GOOGLE_OAUTH2_CLIENT_ID, | |
client_secret = settings.GOOGLE_OAUTH2_CLIENT_SECRET, | |
scope = settings.GOOGLE_SCOPE, | |
redirect_uri = settings.OAUTH_REDIRECT_URI, | |
access_type='offline', | |
) | |
auth_uri = flow.step1_get_authorize_url() |
This file contains hidden or 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
/* Enter Your Custom Functions Here */ | |
// Add custom validation for CF7 form fields | |
function is_company_email($email){ // Check against list of common public email providers & return true if the email provided *doesn't* match one of them | |
if( | |
preg_match('/@gmail./i', $email) || | |
preg_match('/@hotmail./i', $email) || | |
preg_match('/@live./i', $email) || | |
preg_match('/@msn./i', $email) || | |
preg_match('/@aol./i', $email) || |