Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Miller scott

View GitHub Profile
View gist:61700
class DocSweeper < ActionController::Caching::Sweeper
observe Doc
def after_save(doc)
expire_page_for(doc)
end
def after_destroy(doc)
expire_page_for(doc)
@scott
scott / Vertster.com Alternate Conversion Tracking Snippet.js
Created Mar 25, 2009
Use this code for capturing conversion actions when you have multiple conversion pages for the same test or cannot use the standard script.
View Vertster.com Alternate Conversion Tracking Snippet.js
<!-- Conversion Code -->
<script language="JavaScript" type="text/JavaScript">
var code_version = "1";
var pageID = "9999"; // <=== IMPORTANT replace this with your pageID
var code_domain = "r.vertster.com";
var rotate_domain = "r.vertster.com";
View gist:105229
<!-- Sales Conversion Code -->
<script language="JavaScript" type="text/JavaScript">
var code_version = "1";
var pageID = "9999"; // <=== IMPORTANT replace this with your pageID
var code_domain = "r.vertster.com";
var rotate_domain = "r.vertster.com";
View gist:143871
namespace :highrise do
desc 'import contacs from csv'
task :import_contacts => :environment do
require 'csv'
puts 'Importing CSV file. This may take a while if you have a lot of contacts.'
View vswap.wistia-tracker.js
/*
* Tracks a video's play progress via Vertster
* http://wistia.com/
*
* Usage:
*
* Vswap.trackWistiaVideo(560, 'wistia_123', 63.0);
*
* Note: This currently only works with a Wistia video embed but could be easily adapted to
* work with YouTube or other video players.
@scott
scott / widget.js
Created Dec 28, 2015 — forked from lukencode/widget.js
Starter template for creating jsonp embeddable widgets.
View widget.js
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
@scott
scott / helpybgimage.css
Last active Jan 18, 2017
Add these styles to your design CSS overrides to add a background image to your Helpy
View helpybgimage.css
.flat-main-panel, .main-option {
background-color: transparent;
color: #fff;
}
.flat-main-panel {
background-image: url('http://your.helpy.io/uploads/your/image/file/3/notebook-1280538_1920.jpg');
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
background-size: 100%;
@scott
scott / buttons.js
Created Jul 24, 2018
Add 3 buttons to Helpy
View buttons.js
<script>
$(document).ready(function(){
var button = function(url, icon, linked_text) {
var $icon = $('<i class="circle-icon"></i>')
.addClass(icon)
.css('color', '#666');
var $buttonLink = $("<a></a>")
.attr('href',url)
.append($icon)
@scott
scott / oauth.yml
Last active Aug 1, 2019
Sample AUTH_FILE .yml for Helpy Pro
View oauth.yml
omniauth:
providers:
saml:
# Name for the attribute service. Defaults to Required attributes.
attribute_service_name: "Helpy"
# The URL at which the SAML assertion should be received.
# Should be of the format yourURL/users/auth/saml/callback
assertion_consumer_service_url: "http://yourdomain/users/auth/saml/callback"