Skip to content

Instantly share code, notes, and snippets.

View tylr's full-sized avatar

Tyler Love tylr

View GitHub Profile
@tylr
tylr / bdg-member-platform-pitch.md
Last active April 18, 2026 19:59
BDG Member & Events Platform — Capabilities Pitch

BDG Memberships Platform

The Deepest First-Party Data Layer in Digital Media.


The Profile Is the Product

Most media companies sell reach. BDG Memberships sells certainty.

BDG's Memberships platform is a direct, consented relationship with the people who care most about our brands. Not anonymous visitors. Not modeled lookalikes. Known individuals — who signed up, linked their social accounts, bought tickets, attended events, and built a relationship with BDG over years.

@tylr
tylr / bid_optimizer_query.sql
Created April 3, 2026 21:09
Profit-Maximizing Bid Optimizer - Google Ads + Taboola
-- =============================================================================
-- Profit-Maximizing Bid Optimizer — Google Ads + Taboola
-- =============================================================================
-- Uses log-log elasticity estimated from 90-day ArbDaily history,
-- then grid-searches all valid cent-integer bids to find the bid
-- that maximizes estimated daily profit per ad group.
--
-- Key columns in output:
-- suggested_bid — the profit-maximizing cent-integer bid
-- implied_margin — margin implied by that bid (1 - bid/vps)
@tylr
tylr / bid_optimizer_query.sql
Created April 3, 2026 21:09
Profit-Maximizing Bid Optimizer — Google Ads + Taboola (BDG ArbDaily)
-- =============================================================================
-- Profit-Maximizing Bid Optimizer — Google Ads + Taboola
-- =============================================================================
-- Uses log-log elasticity estimated from 90-day ArbDaily history,
-- then grid-searches all valid cent-integer bids to find the bid
-- that maximizes estimated daily profit per ad group.
--
-- Key columns in output:
-- suggested_bid — the profit-maximizing cent-integer bid
-- implied_margin — margin implied by that bid (1 - bid/vps)
@tylr
tylr / geodesix_nightly_sync.py
Created March 19, 2026 14:02
BDG Geodesix Nightly Sync — pushes affiliate/shopping articles to Geodesix S3 data queue
#!/usr/bin/env python3
"""
Geodesix Nightly Sync
=====================
Pushes BDG affiliate/shopping articles (all sites) to Geodesix data pipeline.
Rules:
- Tags: "affiliate" OR "shopping"
- Exclude: sponsored=true
- Exclude: any tag slug/name containing "sponsored"
@tylr
tylr / get-revision.js
Created July 16, 2016 22:15
ember-cli-deploy integration with dynamodb
import AWS from 'aws-sdk'
import Promise from 'bluebird'
const env = global.env.env
const ddb = new AWS.DynamoDB({ region: 'us-east-1' })
const TableName = global.env.dynamodb.TableName
const revisionPrefix = global.env.revisionPrefix
const revisionEnv = env === 'development' ? 'beta' : env
export default ({ revision = null } = {}) => {
@tylr
tylr / server.js
Last active January 19, 2016 00:15
Running Ember FastBoot in AWS Lambda
var path = require('path');
var FastBootServer = require('./lib/models/server');
var outputPath = 'fastboot-dist';
var appName = 'dummy';
var server = new FastBootServer({
appFile: findAppFile(outputPath, appName),
vendorFile: findVendorFile(outputPath),
htmlFile: findHTMLFile(outputPath)
});
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client();
var eventPattern = /([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\" \"(.*?)\"/;
exports.handler = function(data, context) {
var events = [];
var encodedEvent, rawEvent,
matchedEvent, event, i,
commands;
class BustleModel < Ohm::Model
include ActiveModel::Validations
def save
return false unless valid?
super
end
end
class Channel < BustleModel
redis-cli KEYS *rails-cache* | xargs redis-cli DEL
@tylr
tylr / gist:a5ae2c90de0958991bd1
Created July 16, 2014 05:59
Parse Raw Voyager 1 and 2 Pulse Wave Spectrum Analyzer DAT files
require 'pry'
require 'pry-byebug'
require 'date'
require 'json'
def raw_samples
format = 's7c2s16'
samples = []
open('./sample2.dat', 'rb') do |file|