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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
<%@ Page language="c#" %> | |
<%@ Import Namespace="Sitecore.Data.Items" %> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Cache Admin</title> | |
<link rel="shortcut icon" href="/sitecore/images/favicon.ico" /> | |
<% | |
var db = Sitecore.Configuration.Factory.GetDatabase("master"); | |
Func<Item[]> ReturnAllItems = () => |
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
public static Item GetFallbackItem(this Item item) | |
{ | |
Assert.IsNotNull(item, "item cannot be null"); | |
var success = false; | |
int iterations = 0, maxIterations = 5; | |
while (iterations++ < maxIterations) | |
{ | |
var fallbackLang = item.Language.GetFallbackLanguage(item.Database); | |
if (fallbackLang != null && |
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
// ==UserScript== | |
// @name MyPlate Improvements | |
// @namespace http://glompix.com/ | |
// @version 0.1 | |
// @description A small set of improvements for LiveStrong's MyPlate app. | |
// @match http://www.livestrong.com/myplate/dashboard/* | |
// @copyright 2014, Stuart Branham | |
// ==/UserScript== | |
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
/* tab-order.js | |
Preserve tab order within Bootstrap tabbables. | |
*/ | |
(function ($) { | |
var _tabKeyCode = 9; | |
var _tabbableSelector = ':input:not([type="hidden"]),a[href]'; // Links can be tabbed to too! | |
function getTabbableElements($el) { | |
return $el.find(_tabbableSelector); | |
} |
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
jQuery.fn.editableSelect = function () { | |
var selects = $(this).filter('select'); | |
selects.each(function () { | |
// Add an edit button to the select control, bootstrap style. | |
var select = $(this); | |
select.wrap('<div class="input-append" />'); | |
var editButton = $('<button class="btn" type="button" title="Enter your own value"><i class="icon-edit"></i></button>'); | |
select.parent().append(editButton); | |
editButton.click(function () { |
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
namespace Poop | |
{ | |
public class FuzzyStringComparer | |
{ | |
/// <summary>Computes lexical similarity of two strings, case insensitive.</summary> | |
/// <returns>Lexical similarity value in the range [0,1].</returns> | |
/// <remarks>http://www.catalysoft.com/articles/StrikeAMatch.html</remarks> | |
public static double CompareLexical(this string str1, string str2) | |
{ | |
if (str1 == str2) |