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 is a utility function that breaks a URL into an object | |
// parseUri 1.2.2 | |
// (c) Steven Levithan <stevenlevithan.com> | |
// MIT License | |
function parseUri(d){for(var a=parseUri.options,d=a.parser[a.strictMode?"strict":"loose"].exec(d),c={},b=14;b--;)c[a.key[b]]=d[b]||"";c[a.q.name]={};c[a.key[12]].replace(a.q.parser,function(d,b,e){b&&(c[a.q.name][b]=e)});return c} | |
parseUri.options={strictMode:!1,key:"source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}}; | |
function getCampaignMedium(landinguri, campcode, refuri){ | |
/**********Campaign managem |
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
'use strict'; | |
var co = require('co'), | |
fs = require('co-fs'), | |
each = require('co-each'); | |
var dive = function* (path) { | |
var items = yield fs.readdir(path); |
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
function couldBePalindromic(word) { | |
let letters = word.split(''); | |
let matches = letters.map(letter => { | |
// How many sets of characters are multiples of 2 | |
return letters.filter((l) => l == letter).length % 2 == 0 | |
}) | |
// Filter out the ones that aren't | |
.filter((bool) => bool == true) |
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
.xs-overflow-hidden { | |
overflow: hidden !important; } | |
.xs-overflow-auto { | |
overflow: auto !important; | |
-webkit-overflow-scrolling: touch; } | |
.xs-overflow-scroll { | |
overflow: scroll !important; | |
-webkit-overflow-scrolling: touch; } |
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
.xs-flex { | |
display: flex !important; } | |
.xs-flex-order-1 { | |
order: 1 !important; } | |
.xs-flex-order-2 { | |
order: 2 !important; } | |
.xs-flex-order-3 { |
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
.text-input, | |
.text-input--small, | |
.textarea, | |
.textarea--small, | |
.select, | |
.select--small { | |
font-family: inherit !important; | |
background: #fff !important; | |
font-size: 1rem !important; | |
line-height: 1.5rem !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
[ | |
{ | |
"city": "Los Angeles", | |
"name": "Panda Express", | |
"title": "Behold: The Orange Chicken Burrito From Panda Express", | |
"latlong": "33.991521, -117.933127", | |
"video_id": 12771, | |
"bf_url": "", | |
"video_url": "https://www.facebook.com/buzzfeedbringme/videos/1514809721887184/", | |
"status": "Uploaded", |
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 { readdir, readFile } from 'node:fs/promises'; | |
// Update this path to point to a directory of log files. | |
const logPath = './fastly-logs'; | |
const files = await readdir(logPath); | |
// This map holds pairs of page name and page regex and is used to group requests into page types. | |
// The regex for each is tested against the url of the request in the logline | |
/// You should update this map to be relevant for the requests you're interested in. | |
const types = new Map([ |
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
# 1. non-shopping post (will hit the else here https://github.com/buzzfeed/mono/blob/master/subbuzz_rendering_api/app/handlers/render.py#L112-L119) | |
curl --location --request POST 'https://subbuzz-rendering-api.dev.buzzfeed.io/v1/render/bpage' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw '{"subbuzzes":[{"bfp_data":{"clients":[{"amp":{"supported":1,"version":""}},{"android":{"supported":0,"version":""}},{"apple_news":{"supported":1,"version":""}},{"ia":{"supported":1,"version":""}},{"ios":{"supported":0,"version":""}},{"oo_web":{"supported":1,"version":""}},{"smartnews":{"supported":0,"version":""}}],"data":{"amp":false,"apple_news":{"hidden":true,"role":"container"},"ia":false,"web":[{"attributes":[{"key":"id","value":"abb27cbb541044028dd5d8fc6e3c4952"}],"children":[{"content":"(new Image()).src = '\''https://capi.connatix.com/tr/si?token=dc1d8343-8081-406d-9a5e-53dc0c4e1021&cid=1bf35e8b-3d55-48a6-aef8-0ebfdd277df7'\''; cnx.cmd.push(function() { cnx({ playerId: \"dc1d8343-8081-406d-9a5e-53dc0c4e10 |