Skip to content

Instantly share code, notes, and snippets.

View vegagame's full-sized avatar

D. Casanuova vegagame

  • Italia
View GitHub Profile
@vegagame
vegagame / lambda.js
Created April 16, 2020 13:52
Lamda for Cloudfront redirect mobile to desktop
exports.originReqDetect = (event, context, callback) => {
const isDesktopHeader = 'CloudFront-Is-Desktop-Viewer';
const isTabletHeader = 'CloudFront-Is-Tablet-Viewer';
console.log("Event", JSON.stringify(event));
const request = event.Records[0].cf.request;
const headers = request.headers;
const isDesktop =
@vegagame
vegagame / abTest.js
Last active October 14, 2015 16:36
AdBlock A/B test code
/**
* This code work with:
* jQuery 1.x
* Google Analytics trackin code
* https://github.com/sitexw/BlockAdBlock/blob/master/blockadblock.js
* https://github.com/carhartl/jquery-cookie/blob/master/src/jquery.cookie.js
* #article Article id
* #overlay transparence overlay
*/
var adbStart = false;