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
{ | |
"sub": "5cb14773-584b-450a-9204-b0be325d72ce", | |
"iat": 1385066178, | |
"verified_claims": { | |
"verification": { | |
"outcome": "VERIFIED_SUCCESSFULLY", | |
"trust_framework": "uk_tfida", | |
"profile": "M0X", | |
"assurance_policy": "GPG_45" | |
"confidence_level": "medium", |
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
const ENDPOINT_HOST = "https://app.vouchsafe.id/api/v1" | |
// Step 1. Get client ID and secret from the dashboard | |
const CLIENT_ID = "YOUR_CLIENT_ID_HERE" | |
const CLIENT_SECRET = "YOUR_CLIENT_SECRET_HERE" | |
// Step 2. Trade client id and secret for a time-limited access token | |
const getAccessToken = async () => { | |
const res = await fetch(`${ENDPOINT_HOST}/authenticate`, { | |
method: "POST", |
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
//////////// | |
// REACT APP | |
//////////// | |
// Your login screen | |
<GoogleLogin | |
clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID} | |
buttonText="Sign in with Google" | |
className="ct-button ct-button--secondary" |
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
import React, { createContext, useContext } from "react" | |
import useSWR from "swr" | |
const AuthContext = createContext(false) | |
export const AuthProvider = (props) => { | |
const { data, error, mutate } = useSWR(`/api/v1/auth/me`) | |
const googleLogIn = async googleData => { |
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
create table employees ( | |
id SERIAL PRIMARY KEY, | |
first_name VARCHAR(50), | |
last_name VARCHAR(50), | |
email VARCHAR(50), | |
street_address VARCHAR(50), | |
postcode VARCHAR(50), | |
department VARCHAR(50), | |
currently_employed VARCHAR(50), | |
employed_from DATE, |
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 | |
// Make WP recognise the extra query parameter | |
function example_query_vars( $qvars ) { | |
$qvars[] = 'location'; | |
return $qvars; | |
} | |
add_filter( 'query_vars', 'example_query_vars' ); |
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
SELECT ASSETS.[Asset ID], ASSETS.[GET category], ASSETS.KeyWords, ASSETS.ACMD, ASSETS.CR, ASSETS.DO, ASSETS.EL, ASSETS.SG, ASSETS.SCG, ASSETS.SA, ASSETS.YPA, ASSETS.[Local Area], ASSETS.Area, ASSETS.Organisation, ASSETS.Meeting, ASSETS.MO, ASSETS.TU, ASSETS.WE, ASSETS.TH, ASSETS.FR, ASSETS.ST, ASSETS.SU, ASSETS.DaytimeMeetings, ASSETS.[Time-Date], ASSETS.Venue, ASSETS.Postcode, ASSETS.Cost, ASSETS.ContactName, ASSETS.ContactNo, ASSETS.Website, ASSETS.ContactEmail, ASSETS.Description, ASSETS.[Last-Updated], ASSETS.ReviewDate, ASSETS.[Status-of-Review], ASSETS.[Review Notes], ASSETS.Assigned, ASSETS.ReviewNumber, [Page 2].[Age YP], [Page 2].[Age YA], [Page 2].[Age OA], [Page 2].[Local Area], [Page 2].[LAF GAyl], [Page 2].[LAF Wadd], [Page 2].[LAF C&CV], [Page 2].[LAF Beec], [Page 2].[LAF W&D], [Page 2].[LAF NWC], [Page 2].[LAF GBWI], [Page 2].[LAF H&LC], [Page 2].[LAF SWC&M], [Page 2].[LAF Amer], [Page 2].[LAF Buck], [Page 2].[LAF HW], [Page 2].[LAF W&I], [Page 2].[LAF CWV], [Page 2].[LAF Chal], [Page 2].[LAF W |
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
var elements = document.querySelectorAll('body *') | |
for (i = 0; i < elements.length; i++) { | |
if (getComputedStyle(elements[i]).position === 'fixed') elements[i].parentNode.removeChild(elements[i]) | |
} | |
document.querySelector('body').setAttribute('style', 'overflow-y:scroll !important'); | |
document.querySelector('html').setAttribute('style', 'overflow-y:scroll !important'); |
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
// This function should return a user object. Does it? | |
module.exports.getUser = function(){ | |
var user = { | |
firstName: "Dave", | |
lastName: "Bowman", | |
occupation: "Astronaut", | |
admin: false | |
} | |
return; |
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
// A function which returns an object after one second | |
var getData = function(cb){ | |
setTimeout(function(){ | |
var data = { | |
data: "Some data", | |
moreData: "And more data", | |
lastData: true | |
} | |
cb(data) | |
}, 1000) |