Skip to content

Instantly share code, notes, and snippets.

Stuart stuwilli

View GitHub Profile
View gist:1a4d503f6e8db523540e77f381990cb9
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
View freewheel-adblock-survey.js
(function() {
function getFrame() {
if (!document.getElementById('akami-research-frame')) {
var iframe = document.createElement('iframe');
iframe.id = 'akami-research-frame';
iframe.src = 'about:blank';
iframe.style.width = '1px';
View .tern-config
{
"ecmaVersion": 5,
"libs": [
"browser",
"jquery"
],
"plugins": {
"complete_strings": {},
"node": {},
"lint": {},
View mraid-image-splash-template.html
<script src="mraid.js"></script>
<style>
body {
background: black;
margin: 0;
padding: 0;
}
#advert {
width: 640px;
}
View mraid-template.html
<script src="mraid.js"></script>
<script>
function redirect(){
mraid.open("");
}
function close() {
mraid.close();
}
@stuwilli
stuwilli / gist:483e94de00b762ab1ba4
Last active Sep 18, 2015
GPT Resize Freewheel Frame
View gist:483e94de00b762ab1ba4
<!--nosandbox-->
<div id='div-gpt-ad-1234567891234-728x90'></div><!-- change this elements id so it's unique -->
<script type="text/javascript">
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement("script");
gads.async = true;
gads.type = "text/javascript";
var useSSL = "https:" == document.location.protocol;
@stuwilli
stuwilli / gist:16c9a6aa8bdfcc12e0b5
Last active Aug 29, 2015
JS-XLSX Create Workook
View gist:16c9a6aa8bdfcc12e0b5
var ws_name = 'SheetJS';
/* set up workbook objects -- some of these will not be required in the future */
var wb = {};
wb.Sheets = {};
wb.Props = {};
wb.SSF = {};
wb.SheetNames = [];
/* create worksheet: */
var ws = {}
@stuwilli
stuwilli / gist:b2359d8d2efc97160166
Last active Aug 29, 2015
Install PPAPI Debug in Chrome
View gist:b2359d8d2efc97160166
Download and Install
#http://fpdownload.macromedia.com/pub/flashplayer/updaters/17/flashplayer_17_ppapi_debug.dmg
ln -s /Library/Internet\ Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin /Applications/Google\ Chrome.app/Contents/Versions/43.0.2357.81/Google\ Chrome\ Framework.framework/PepperFlashPlayer.plugin
ln -s /Library/Internet\ Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin /Applications/Google\ Chrome.app/Contents/Versions/44.0.2403.130/Google\ Chrome\ Framework.framework/Internet\ Plug-Ins/PepperFlash/PepperFlashPlayer.plugin
Path to Log
~/Library/Application\ Support/Google/Chrome/Default/Pepper\ Data/Shockwave\ Flash/WritableRoot/Logs/flashlog.txt
@stuwilli
stuwilli / has-ad-enabled-player.js
Last active Aug 29, 2015
Has Brightcove Ad Enabled Player
View has-ad-enabled-player.js
function hasAdEnabledPlayer() {
if (typeof brightcove !== 'undefined') {
try {
for (var k in brightcove.experiences) {
console.log('checking player ' + k);
if (brightcove.api.getExperience(k).modules.hasOwnProperty('advertising')) {
return true;
} else if (brightcove.getExperience(k).modules.hasOwnProperty('advertising')) {
return true;
}
View ie-detect.js
function isIE () {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 0; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
You can’t perform that action at this time.