Skip to content

Instantly share code, notes, and snippets.

# Getting the actual commit id, in case we were passed a tag
# or partial sha or something - it will return the sha if you pass a sha, too
def query_revision(revision)
raise ArgumentError, "Deploying remote branches has been deprecated. Specify the remote branch as a local branch for the git repository you're deploying from (ie: '#{revision.gsub('origin/', '')}' rather than '#{revision}')." if revision =~ /^origin\//
return revision if revision =~ /^[0-9a-f]{40}$/
command = scm('ls-remote', repository, revision)
result = yield(command)
result = result.split("\n")[1]
revdata = result.split("\t")
newrev = revdata[0]
## Layout file except
#navigation
%ul#mainNav.sf-menu
= partial('shared/bluemango_nav')
.clear
- if @sub_nav
#subnavigation
%ul#subNav
= @sub_nav
ScreenStepsLiveSearchOptions = {
domain: "youraccount.screenstepslive.com",
space: "your space id",
update_element: "screenstepslive-search-results",
username: "login",
password: "password",
use_ssl: false
}
div#screenstepslive-search-results ul li {
list-style: disc;
}
require "google_util"
consumer = OAuth::Consumer.new('anonymous', 'anonymous', {
:site => 'https://www.google.com',
:request_token_path => '/accounts/OAuthGetRequestToken',
:access_token_path => '/accounts/OAuthGetAccessToken',
:authorize_path => '/accounts/OAuthAuthorizeToken'
})
require "google_util"
consumer = OAuth::Consumer.new('anonymous', 'anonymous', {
:site => 'https://www.google.com',
:request_token_path => '/accounts/OAuthGetRequestToken',
:access_token_path => '/accounts/OAuthGetAccessToken',
:authorize_path => '/accounts/OAuthAuthorizeToken'
})
## I have also tried the above with :site => 'https://apps-apis.google.com'
@bluemango
bluemango / sslive_live_text_replace.js
Created October 29, 2010 19:20
Script for replacing strings on ScreenSteps Live
jQuery(document).ready(function($) {
rss_text = "Subscribe";
tags_text = "Tags";
search_button_text = "Search";
sidebar_search_text = "Search";
other_assets_text =" Other Resources";
navigation_header_text = "Navigation";
toc_text = "Manual Table of Contents";
choose_lesson_text = "Choose a lesson";
manual_pdf_text = "Downlaod Manual PDF";
@bluemango
bluemango / gist:1253340
Created September 30, 2011 10:09
Add search box on empty search results
$(document).ready(function() {
if (
($('.site-search #screensteps-inner-content').length > 0) || ($('.manual-search #screensteps-inner-content').length > 0)
)
{
if ($('#found-lessons').length < 1)
{ $('#screensteps-inner-content').append("<h2>Submit a ticket</h2>") }
}
});
@bluemango
bluemango / gist:1365067
Created November 14, 2011 20:34
Dual searh button for Zendesk/ScreenSteps Live
jQuery("#search_box").text("Search");
if (jQuery("#suggestion_submit")) {
jQuery("#suggestion_submit").val("Search Forums");
var html_string = '<input type="submit" name="commit" value="Search Docs" class="button search primary" id="screensteps-search-submit"/>'
jQuery("#suggestion_submit").before(html_string);
jQuery("#suggestion_submit").removeClass('primary');
jQuery("#screensteps-search-submit").css("margin-left", "0px").before("<br /><br />");
jQuery("#screensteps-search-submit").click(function(e){
'SELECT `lessons`.`id` * 1 + 0 AS `id`,
`spaces`.`id` AS `published_space_id`
FROM lessons
LEFT JOIN readings on lessons.id = readings.lesson_id AND lessons.draft = 0
LEFT JOIN sections on readings.section_id = sections.id AND sections.hidden = 0
LEFT JOIN manuals on manuals.id = sections.manual_id AND manuals.draft = 0
LEFT JOIN assets_spaces as manual_assets ON manual_assets.asset_id = manuals.id AND manual_assets.asset_type = "Manual"
LEFT JOIN spaces ON manual_assets.space_id = spaces.id'