Skip to content

Instantly share code, notes, and snippets.

View akojif's full-sized avatar
🏠
Working from home

Francis Akoji akojif

🏠
Working from home
View GitHub Profile
@akojif
akojif / optimize-ga.js
Last active September 2, 2024 09:22
Optimize Core Web Vitals: Fix Render-Blocking JavaScript with Google Analytics
function loadGoogleAnalytics() {
return new Promise((resolve, reject) => {
// Create the script element for Google Analytics
const script = document.createElement("script"); // change the variable to 'var' if Elementor
script.async = true;
script.src =
"https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID_HERE";
//script.onload = resolve;
script.onload = () => {
// Remove this function after testing and un-comment the line above this
@akojif
akojif / server.js
Created June 30, 2020 12:19 — forked from joshj/server.js
Twitter OAuth with node-oauth for node.js+express
/*
Node.js, express, oauth example using Twitters API
Install Node.js:
curl -0 http://nodejs.org/dist/v0.6.11/node-v0.6.11.tar.gz
tar -zxf node-v0.6.11.tar.gz
cd node-v0.6.11
./configure
make
make install