Skip to content

Instantly share code, notes, and snippets.

View chrisgalard's full-sized avatar
💭
Hacking some stuff :)

Christian Cisneros chrisgalard

💭
Hacking some stuff :)
View GitHub Profile
@chrisgalard
chrisgalard / get-url-parameters.js
Created April 29, 2020 14:56
Get query string parameters from the URL
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};
@chrisgalard
chrisgalard / get-clickfunnels-data-from-localstorage.js
Last active September 20, 2022 03:57
Get clickfunnels data from localStorage into a global object named clickfunnelsData
function getClickfunnelsData() {
var clickfunnelsData = {};
var dataPoint = null;
var allKeys = Object.keys(localStorage);
var clickfunnelsKeys = allKeys.filter(function(key) {
// Return only keys that match the format garlic:hostname*>input.data
return key.match(/garlic:.+\*>input\.(.+)/) !== null;
});
clickfunnelsKeys.forEach(function(key) {
dataPoint = key.match(/garlic:.+\*>input\.(.+)/)[1];
@chrisgalard
chrisgalard / cf-reset.css
Last active December 7, 2023 00:13
As I do a lot of custom work in Clickfunnels, I created this gist to save all the CSS rules I re-use in all my projects just to make the pages look a lot better in both mobile and desktop
@import url('CUSTOM FONT URL FROM GOOGLE FONTS OR FROM CDN FONTS');
/* Font weights */
[data-title~='fw-light'] .elHeadline { font-weight: 300; }
[data-title~='fw-regular'] .elHeadline { font-weight: 400; }
[data-title~='fw-medium'] .elHeadline { font-weight: 500; }
[data-title~='fw-semibold'] .elHeadline { font-weight: 600; }
[data-title~='fw-bold'] .elHeadline { font-weight: 700; }
[data-title~='fw-extrabold'] .elHeadline { font-weight: 800; }
[data-title~='fw-black'] .elHeadline { font-weight: 900; }