Skip to content

Instantly share code, notes, and snippets.

View andyblackwell's full-sized avatar

Andy Blackwell andyblackwell

View GitHub Profile
@andyblackwell
andyblackwell / bidder_factory.js
Created June 12, 2018 17:27
Prebid.js: Adding "no bids" back into bids received ( https://github.com/prebid/Prebid.js/issues/2640 )
import Adapter from 'src/adapter';
import adaptermanager from 'src/adaptermanager';
import { config } from 'src/config';
import bidfactory from 'src/bidfactory';
import { userSync } from 'src/userSync';
import { nativeBidIsValid } from 'src/native';
import { isValidVideoBid } from 'src/video';
import CONSTANTS from 'src/constants.json';
import events from 'src/events';
import includes from 'core-js/library/fn/array/includes';
@andyblackwell
andyblackwell / parse_query_params.js
Created October 12, 2012 06:09
Parse query string values from the url into a js object
var query_params = {}, qs = document.location.search; qs.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"), function($0, $1, $2, $3){ query_params[$1] = decodeURIComponent($3).replace('+',' '); });
// http://your.url?hello=world&search=shoes&debug
// query_params.hello >> 'world'
// query_params.search >> 'shoes'
// if( query_params.debug ) console.log('debug mode on!');
// if( !query_params.huh ) console.log('nope');