Skip to content

Instantly share code, notes, and snippets.

View francescostella's full-sized avatar
🌟
Loading...

Francesco Stella francescostella

🌟
Loading...
View GitHub Profile
@francescostella
francescostella / gist:c0bcd542d64aa12191a5724a45302527
Created October 17, 2018 19:18
Venetian/Palazzo referer detection for 'Back to' link
let referrerUrl = document.referrer;
let referrerUrlMatch = referrerUrl.match(/^https?:\/\/www\.(venetian|palazzo)\.com(?!\/meetings(\/|$))/);
let referrerName = referrerUrlMatch ? referrerUrlMatch[1] : null;

At that point, referrerName is either “venetian", "palazzo", or null (if referrer URL was from neither of the two sites, or if the path started with “/meetings/“), and the referrerUrl can be used as needed.

Examples: "https://www.venetian.com/meetings” returns null

@francescostella
francescostella / SassMeister-input.sass
Created July 7, 2015 22:44
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
.test
$char: "E008"
$res: ""
@for $i from 1 through 4
$res: $res + $char