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
// dependencies | |
var async = require('async'); | |
var path = require('path'); | |
var AWS = require('aws-sdk'); | |
var gm = require('gm').subClass({ | |
imageMagick: true | |
}); | |
var util = require('util'); | |
// get reference to S3 client | |
var s3 = new AWS.S3(); |
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
// Init Segment | |
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0"; | |
analytics.load("YOUR_WRITE_KEY"); | |
ana |
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
// ==UserScript== | |
// @name Google Analytics Realtime Alerts | |
// @namespace http://mobilecoder.wordpress.com | |
// @version 1.0 | |
// @description Plays a sound when you get a new user, you can change the sound by hosting your own file on dropbox or other web location | |
// @match https://www.google.com/analytics/web/?hl=en#realtime* | |
// ==/UserScript== | |
// Your custom sound goes here | |
mCoinSound = new Audio("https://dl.dropbox.com/u/7079101/coin.mp3"); |
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( | |
ISBLANK(A2); | |
""; | |
SUBSTITUTE( | |
CONCATENATE( | |
A2; | |
"?"; | |
IF( | |
ISBLANK(B2); | |
""; |
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
# File is saved under /etc/init/start_containers.conf | |
# After file is modified, update config with : $ initctl reload-configuration | |
description "Start containers (see http://askubuntu.com/a/22105 and http://askubuntu.com/questions/612928/how-to-run-docker-compose-at-bootup)" | |
start on filesystem and started docker | |
stop on runlevel [!2345] | |
# if you want it to automatically restart if it crashes, leave the next line in | |
# respawn # might cause over charge |
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
# Based on https://stackoverflow.com/a/798893/2550237 | |
import itertools | |
import csv | |
games = ["Angry Birds", "Clash of Clans"] | |
platforms = ["iOS", "Android"] | |
dates = ["1/1/2018", "1/2/2018", "1/3/2018", "1/4/2018", "1/5/2018", | |
"1/6/2018", "1/7/2018", "1/8/2018", "1/9/2018", "1/10/2018", | |
"1/11/2018", "1/12/2018"] |
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
<?php | |
// Replace with your access token | |
$access_token = 'your_access_token'; | |
// PURCHASE DATA | |
// Replace with your own customer/purchase data | |
$data = array(); | |
$data["match_keys"]["lead_id"] = "1234"; | |
$data["event_time"] = 1477632399; |
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() { | |
var url = new URL({{Page URL}}); | |
var final_price = url.searchParams.get("final_price"); | |
return (final_price/100); | |
} |
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
from django.contrib.auth.models import User | |
import csv | |
writer = csv.writer(open("email.csv", 'w')) | |
qs = User.objects.all().values("email") | |
for obj in qs: | |
row = [] | |
if type(obj['email']) == unicode: | |
email = obj['email'].encode("utf-8") | |
row.append(email) | |
writer.writerow(row) |
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
<!-- Load the JQuery library --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
<script> | |
// Needs to be loaded after jquery | |
var chosenVariation = cxApi.chooseVariation(); | |
console.log("Experiments is ON. Visitor will see variant : ", chosenVariation); | |
// Define JavaScript for each page variation of this experiment. | |
var pageVariations = [ | |
function() { // Original: We don't change the page at all |
NewerOlder