This file contains hidden or 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
/* | |
This query will return a frequency analysis, e.g. number of active days in time window. | |
If you ask for 28 days, it will give you the # of users who did your event 1 unique day, 2 unique days, etc | |
in the time window. | |
*/ | |
function main() { | |
return Events({ | |
from_date: '2018-07-01', | |
to_date: '2018-07-28', |
This file contains hidden or 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
// get distribution of active days per company over a week. | |
// e.g. "100 companies were active 1 day, 200 were active 2 days, ..., 65 were active 7 days" | |
function main() { | |
return Events({ | |
from_date: "2016-08-21", | |
to_date: "2016-08-26" | |
}) | |
// dedupe into (day, company_id) tuples, because all we care about is | |
// that the company was present that day |
This file contains hidden or 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
on run argv | |
tell application "iTerm" | |
activate | |
global hostname | |
set hostname to "dev" | |
if length of argv is 1 then | |
set hostname to item 1 of argv | |
end if | |
set term to (make new terminal) | |
tell term |
This file contains hidden or 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 onYouTubePlayerReady(playerId) { | |
ytplayer = document.getElementById("myytplayer"); | |
ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); | |
} | |
function onytplayerStateChange(newState) { | |
ytplayer = document.getElementById("myytplayer"); | |
var props = {}; | |
props['duration'] = ytplayer.getDuration(); |
This file contains hidden or 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() { | |
// http://www.cardpool.com/buy-gift-cards | |
var table = $($("table.merchants_grid")[0]); | |
var boxes = table.find("td.merchant_cell"); | |
boxes.sort(function(a, b) { | |
var val1 = parseInt($(a).find('.merchant_discount').text()), | |
val2 = parseInt($(b).find('.merchant_discount').text()); | |
return val2 - val1; | |
}); |
This file contains hidden or 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
<html> | |
<head></head> | |
<body> | |
<h1>hi</h1> | |
</body> | |
<!-- start Mixpanel --><script type="text/javascript">(function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+'//api.mixpanel.com/site_media/js/api/mixpanel.2.js';b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config".split(" "); | |
for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]); | |
mixpanel.init("tim", { debug: true });</script><!-- end Mixpanel --> | |
This file contains hidden or 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
$("#form_id").submit(function(e) { | |
var form = $(this).get(0), | |
submitted = false; | |
function submit_form() { | |
if (!submitted) { | |
document.createElement('form').submit.call(form); | |
submitted = true; | |
} | |
} |
This file contains hidden or 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
port 1194 | |
proto udp | |
dev tun | |
# Keys we generated earlier | |
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt | |
cert /etc/easy-rsa/2.0/keys/server.crt | |
key /etc/easy-rsa/2.0/keys/server.key # This file should be kept secret | |
dh /etc/easy-rsa/2.0/keys/dh1024.pem |
This file contains hidden or 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
<script type="text/javascript" src="http://mixpanel.com/site_media/js/api/mixpanel.js"></script> | |
<script type="text/javascript"> | |
try { | |
var mpmetrics = new MixpanelLib("YOUR_TOKEN"); | |
mpmetrics.set_config({ cross_subdomain_cookie: false }); | |
mpmetrics.register({"user type": "noob", "gender": "male"}); | |
} catch(err) {} | |
</script> |
This file contains hidden or 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
<script type="text/javascript" src="http://api.mixpanel.com/site_media/js/api/mixpanel_fb.js"></script> | |
<script type="text/javascript"> | |
try { | |
var mpmetrics = new MixpanelLib("YOUR TOKEN"); | |
} catch(err) { | |
null_fn = function () {}; | |
var mpmetrics = { track: null_fn, track_funnel: null_fn }; | |
} | |
</script> |
NewerOlder