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
/** | |
Sends the submitted payload of a Google Form to Segment. | |
Steps to install: | |
1. modify the script below to include your base64 encoded write key (with a colon at the end!) per the Segment docs | |
2. set the event name you want | |
3. add as a script to your Google Form (More > Script Editor) | |
4. add "https://www.googleapis.com/auth/script.external_request" & "https://www.googleapis.com/auth/forms" to your oauthScopes key in appscript.json | |
5. set your script trigger to onFormSubmit |
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 | |
// this is a route filter that goes in your filters.php file | |
// you'll call this on a route by doing something like Route::get('/api/whatever', ['before' => 'auth.api'], function() {whatever}); | |
Route::filter('auth.api', function() | |
{ | |
// get the basic auth username | |
$key = Request::getUser(); | |
// get the basic auth password | |
$secret = Request::getPassword(); |
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 | |
// You must include the PHP file from here for this to work: https://github.com/ccampbell/chromephp | |
// In Codeigniter, simply save the PHP file in the "Libraries" directory | |
function consolelog($stuff) | |
{ | |
if(ENVIRONMENT == 'production') | |
{ | |
return; |
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
cd /html | |
wget http://wordpress.org/latest.tar.gz | |
tar -xzf latest.tar.gz | |
cp -R wordpress/* . | |
rm latest.tar.gz | |
rm -rf wordpress/ |
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
// This assumes Facebook buttons are using the Facebook Javascript SDK. | |
// Thanks to Google for most of this code, see the Social Interaction Analytics guide at | |
// https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSocial | |
// Facebook provides a Javascript event framework that allows you to subscribe to events | |
// happening within the Facebook Javascript SDK and provides data accordingly. | |
// To track a like, subscribe to the edge.create event and then use the callback to | |
// execute the Analytics tracking code: |
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
// This assumes that you have included the Tweet button via the standard Twitter JS include | |
// Thanks to Google for most of this code, see the Social Interaction Analytics guide at | |
// https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSocial | |
// To track a Tweet, subscribe to the tweet event (note the additional function required | |
// to determine the query parameter being sent to Twitter): | |
function trackTwitter(intent_event) { | |
if (intent_event) { | |
var opt_pagePath; | |
if (intent_event.target && intent_event.target.nodeName == 'IFRAME') { |
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: this assumes you have loaded jQuery | |
$(document).ready(function() { | |
// REPLACE 'UNIQUE_FORM_ID' BELOW WITH THE ID OF YOUR FORM | |
$('#UNIQUE_FORM_ID input').blur(function () { | |
if($(this).val().length > 0) { | |
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_full', $(this).attr('name')]); | |
} | |
else { | |
_gaq.push(['_trackEvent', 'Form: FORM NAME HERE','input_exit_empty', $(this).attr('name')]); |
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: you must also include https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js | |
var tag = document.createElement('script'); | |
tag.src = "https://www.youtube.com/player_api?enablejsapi=1&version=3&showinfo=0"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var player; |
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 bpt_handler($atts) | |
{ | |
extract(shortcode_atts(array( | |
"event_id" => '' | |
), $atts)); | |
$event_data = $this->getBptEvent($event_id); | |
return '<pre>'.$event_data.'</pre>'; | |