This file contains hidden or 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
private void AddAccordionScript() | |
{ | |
StringBuilder sb = new StringBuilder(); | |
sb.AppendLine(" <script type='text/javascript'>"); | |
sb.AppendLine(" var stop = false;"); | |
sb.AppendLine(" $(\"#accordion h3\").click(function (event) {"); | |
sb.AppendLine(" if (stop) {"); | |
sb.AppendLine(" event.stopImmediatePropagation();"); | |
sb.AppendLine(" event.preventDefault();"); | |
sb.AppendLine(" stop = false;"); |
This file contains hidden or 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() { | |
var $blanket = $('#blanket'), | |
$close = $('#lightboxClose'); | |
if ($blanket.size() === 0) | |
{ | |
$blanket = $('<div />', {id: 'blanket'}).css({ | |
'position': 'fixed', | |
'left': '0', | |
'top': '0', |
This file contains hidden or 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
/** | |
These two functions (addEvent and removeEvent) should be added to common.js | |
- they are generally useful functions that could be used across the entire site | |
when custom javascript is needed. The lightbox requires them for use. | |
**/ | |
function addEvent( obj, type, fn ) | |
{ | |
if (obj.addEventListener) | |
{ | |
obj.addEventListener( type, fn, false ); |
This file contains hidden or 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
/** | |
Chat: A factory for multi-room chat clients. | |
methods: | |
create(container, rooms) | |
- container is the ID of the element in which to build the chat interface | |
- rooms is either an encrypted enrollment ID or an array of room definitions | |
- returns a ChatClient (described below) | |
**/ |
This file contains hidden or 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
// Untested, off-the-cuff | |
$.fn.secondClick = function(handler) | |
{ | |
var flag = false; | |
$(this).click(function(e) { | |
if (flag) | |
{ | |
return handler(e); | |
flag = false; |
This file contains hidden or 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 is the ideal situation, where getting search results is abstracted | |
' The stored-proc code is instead moved to the Market class, and thus written only once | |
' no matter how many pages want this data | |
Dim searchMarket as New Market(licenseType, state) ' maybe with more arguments | |
Me.datalistCourses.DataSource = searchMarket.OnlineCourses() ' maybe with more arguments | |
This file contains hidden or 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
Actual "Event" webhook return (partial, decoded to PHP stdClass) | |
stdClass Object | |
( | |
[type] => invoice.payment_succeeded | |
[livemode] => 1 | |
[pending_webhooks] => 1 | |
[object] => event | |
[created] => 1352226885 | |
[id] => evt_0geUCmQmZaf2OD |
This file contains hidden or 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
// factory | |
var createObject = function(stuff) { | |
var obj = {}; | |
obj.stuff = stuff; | |
obj.func = function() | |
{ | |
return this.stuff + ' concatentation'; | |
}; | |
return obj; |
This file contains hidden or 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
/* | |
Applies to: http://feedly.com/home*, http://www.feedly.com/home* | |
*/ | |
body, #feedlyCenter | |
{ | |
background-image: url(https://raw.github.com/ryankinal/mysubtlepatterns/master/debut_dark/debut_dark.png); | |
} | |
.area | |
{ |
This file contains hidden or 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
var PetalsAroundTheRose = (function() { | |
var sides = 6, | |
dice = 5, | |
currentRolls; | |
function getPetals(rolls) | |
{ | |
var score = 0; | |
rolls.forEach(function(item) { | |
if (item === 3 || item === 5) |