Skip to content

Instantly share code, notes, and snippets.

@alextea
alextea / highlightcells.js
Created June 25, 2015 16:49
Function to extract numeric data from mixed content cells and apply a heatmap to them in Google Sheets
function highlightcells() {
var sheet = SpreadsheetApp.getActiveSheet();
var allData = sheet.getDataRange();
var dataRange = sheet.getRange(2,3,allData.getLastRow(),allData.getLastColumn());
var data = dataRange.getValues();
// iterate over data
var values = [];
for (var i = 0; i < data.length; i++) {
@alextea
alextea / _alpha-banner.html
Last active December 27, 2015 02:19
Fix class name
<!-- insert this after the #global-header block -->
<div class="alpha-banner">
<p>
<b>ALPHA:</b> This is a prototype – your <a href="">feedback</a> will help us to improve it. <a href="#">Find out more</a>
</p>
</div>
@alextea
alextea / gist:4586740
Created January 21, 2013 15:13
Javascript snippet to track pixel density ratio.
// track pixel density ratio
if (window.devicePixelRatio) {
_gaq.push(['_setCustomVar', 11, 'Pixel Ratio', String(window.devicePixelRatio), 2 ]);
}