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 Thing(prop) { | |
this.prop = prop; | |
} | |
Thing.prototype.toString = function() { | |
return "My prop is: " + this.prop; | |
}; | |
module.exports = function (opts) { | |
return new Thing(opts); |
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
@resetInputsForForm: (form_html, taskNumber, taskType) -> | |
form = $(form_html) | |
form.find('input').each (index, element) -> | |
taskNamePrefix = "#{taskType}_task" | |
currentName = $(element).attr('name') | |
multipleParamNamePrefix = "inputs_for_task['#{taskNumber}']" | |
newName = currentName.replace(taskNamePrefix, multipleParamNamePrefix) | |
$(element).attr('name', newName) | |
form |
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
$('fieldset').each(function(i){ | |
if (i == 0){ | |
someFunction(); | |
} | |
}); |
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
$(".add_comment_link").click(function() { | |
$(this).next(".add_comment").slideToggle(); | |
}); |
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
<?php | |
/** | |
* Escape special characters. | |
* | |
* See http://en.wikipedia.org/wiki/XML#Escaping | |
*/ | |
function ec_dreammail_escape_xml($string) { | |
$search = array('<', '>', '&', '"', "'"); | |
$replace = array('<', '>', '&', '"', '''); |
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
<?php | |
/** | |
* Implementation of hook_block(). | |
*/ | |
function ec_channel_block($op = 'list', $delta = 0, $edit = array()) { | |
switch ($op) { | |
case 'list': | |
return array( | |
'products_and_events' => array( |
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
$('#model-versions ul li a').click(function() { | |
$('section.left article').animate({opacity: 0 }, 1000).load(this.href + " section.left article"); | |
}); |
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
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
// No more than 30% of requests should take more than 20s. | |
.probe = { | |
.url = "/"; | |
.timeout = 30s; | |
.window = 10; | |
.threshold = 3; |