View ThirdPartyNoticesExample.md
View badge_progress.js
badge_progress: {
// The last time the badge progress was updated, in Unix time
'updated': 1435406007797,
// The unique id of the badge
'the-badge-id': {
// Whether the badge was completed or not. Optional, and false by
// default. If the badge can be completed multiple times, this will
// be true as long as the badge was completed at least once.
completed: true,
// The number of conditions that were completed. Optional, defaults to
View captain_up.rb
class CaptainUp
# Include HTTParty as a mix-in
include HTTParty
# Set up the base API endpoint
base_uri 'captainup.com'
# Initialize the Captain Up SDK
def initialize(options = {})
@options = options
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View captain_up_sign_up_modal.js
captain.up(function() {
// Listen to the `signup:open` event, that's triggered whenever the sign up
// modal is opened.
captain.on('signup:open', function() {
// Replace the sign up modal title with "Hello, World!"
$('#cpt-sign-up-modal h1').text('Hello, World!');
});
});
View minimize_captain_up_hud.js
// Asynchronous wrapper around Captain Up, similar to jQuery's DOM ready. Place this
// snippet on every page where you want the HUD to start in minimized state. Place it
// below the Captain Up script embed snippet in your HTML. The code will run immediately
// after Captain Up finished loading.
captain.up(function() {
// Minimizes the HUD, instantly.
captain.hud.minimize({instantly: true});
});
View custom_daily_visit_action.coffee
// Only run the code when Captain Up has loaded on the page
captain.up(function() {
// Track a new 'daily_visit' custom action
captain.action('daily_visit', {
// Pass extra data about the action
entity: {
// The current page name
name: captain.get_page_title()
// The referrer URL
referrer: captain.player_info.referrer
View nginx.conf
http {
upstream node_server {
server 127.0.0.1:2222;
}
server {
listen 443 ssl;
server_name example.com;
ssl on;
View badge_schema.js
{
// The badge ID
"_id": "52f41c32a3e8e3ec37000021",
// The name of the badge
"name": "One View to Rule Them All",
// The badge description
"description": "Watch a video on our site to get this nifty badge",
// The number of points to award with this badge
"points": 50,
// Whether this badge is active or not
View custom_actions
// Using jQuery: http://jquery.com/
// Wait for Captain Up to finish loading
captain.up(function() {
$('#your-correct-html-selector').click(function() {
captain.action('pust-update', {
entity: {
name: 'provide extra data on the update inside the entity object'
}
});
});