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
// used to make a background image (including alpha images) scale to the size of it's container in ie7 & ie8 | |
.ie7-8-backgroundScale(@filename) { | |
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='@{filename}', sizingMethod='scale'); | |
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='@{filename}', sizingMethod='scale')"; | |
} |
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
/** | |
* A better typeof implementation.<br> | |
* This method will return a proper string for | |
* every object in javascript; including, but not limited to: | |
* 'array' | |
* 'arguments' | |
* 'error' | |
* 'date' | |
* 'regexp' | |
* 'json' |
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
// NOTE: it is suggested that you use very limited credentials | |
// a good solution is to create an IAM user in AWS that has only PUT rights to S3 | |
// use a temporary bucket that has an expiry (24hrs or something low) | |
// once the file is uploaded get your server to move the file to another bucket that has much less | |
// restricted rights. | |
// See: readme for more info | |
// setup the credentials | |
AWS.config.update({ | |
accessKeyId: accessKeyId, |
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
var request = new XMLHttpRequest(); | |
// if the endpoint changes, then manipulation of the returned data may need to change in the onReadyState handler | |
request.open('GET', 'https://api.ipify.org', true); | |
request.onreadystatechange = function() { | |
if (this.readyState === 4) { | |
if (this.status >= 200 && this.status < 400) { | |
// Success! | |
var data = this.responseText; | |
console.log('respose', data); |
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 parseQueryString() { | |
var query = (window.location.search || '?').substr(1), | |
map = {}; | |
query.replace(/([^&=]+)=?([^&]*)(?:&+|$)/g, function(match, key, value) { | |
(map[key] = map[key] || []).push(value); | |
}); | |
return 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
if(window.ga) { | |
var arr = window.ga.getAll(); | |
for (var i = 0, len = arr.length; i < len; i++) { | |
var t = arr[i]; | |
if(console.group) { | |
console.group(t.get('name')); | |
} | |
console.log('Main tracker object:', t); |
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
# Compression | |
# Enable Gzip compressed. | |
gzip on; | |
# Enable compression both for HTTP/1.0 and HTTP/1.1. | |
gzip_http_version 1.1; | |
# Compression level (1-9). | |
# 5 is a perfect compromise between size and cpu usage, offering about |
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
# Proxy Cache Settings | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=reverse_cache:60m inactive=90m max_size=1000m; |
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 getSummary() { | |
var listed = Analytics.Management.AccountSummaries.list(); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); | |
// var baseRangeRow = 4 | |
// sheet.getRange(baseRangeRow,1).setValue(listed.items[0]); | |
// sheet.getRange(baseRangeRow+1,1).setValue(listed.items[0].webProperties[0]); | |
// sheet.getRange(baseRangeRow+2,1).setValue(listed.items[0].webProperties[0].profiles[0]); | |
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
ga(function(tracker) { | |
// Grab a reference to the default sendHitTask function. | |
var originalSendHitTask = tracker.get('sendHitTask'); | |
// Modifies sendHitTask to send a copy of the request to a local server after | |
// sending the normal request to www.google-analytics.com/collect. | |
tracker.set('sendHitTask', function(model) { | |
// sends the original hit task |
OlderNewer