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
<!-- Formatting a number with '#.##;#.##' will return the absolute value --> | |
<xsl:variable name="absoluteValue" select="format-number($originalValue,'#.##;#.##')"/> |
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
<!-- Textarea can be resized as required. Its just used to contain the feed --> | |
<textarea cols='150' rows='30'><xsl:copy-of select='/'/></textarea> |
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
//master function to hold all actions on slider | |
//HTML - you'll need an empty div with id=slider to hold the initiated control | |
$(function() { | |
$( "#slider" ).slider({ | |
value:1, //start pos | |
min: 1, | |
max: 7, //number of slides | |
step: 1, | |
animate: true, | |
change: function( event, ui ) { //run function each time the slider is used |
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
info: Creating snapshot 0.0.1-1 | |
info Uploading: [=============================] 100% | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
help: For help with this error contact Nodejitsu Support: | |
help: webchat: <http://webchat.nodejitsu.com/> | |
help: irc: <irc://chat.freenode.net/#nodejitsu> | |
help: email: <[email protected]> | |
help: | |
help: Copy and paste this output to a gist (http://gist.github.com/) |
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
array = [ | |
{ | |
"id":"1", | |
"type":"a" | |
}, | |
{ | |
"id":"2", | |
"type":"b" | |
} | |
] |
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
_randomNum: (max,min=0) -> | |
return Math.floor(Math.random() * (max - min) + min) | |
# min is set to 0 by default but a different value can be passed to function | |
_randomise: -> | |
randomNum = @_randomNum(10) | |
# returns a random integer between 0 and 10 | |
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
array = [ | |
{ | |
"id":"1", | |
"type":"z" | |
}, | |
{ | |
"id":"2", | |
"type":"a" | |
} | |
] |
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
# check if page loaded within iframe | |
if window.parent != window | |
console.log 'within iframe' | |
# access properties from the parent window object | |
orientation = window.parent.orientation | |
else | |
console.log 'no iframe' | |
# access properties from the window object as normal | |
orientation = window.orientation |
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
class MinMax | |
@min: (array) -> Math.min.apply Math, array | |
@max: (array) -> Math.max.apply Math, array | |
# Use... | |
min = MinMax.min [0,1,2] | |
max = MinMax.max [5,4,3] |
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
_addListeners: -> | |
$(document).on 'click', '.scrollTo', @_onScrollToClick | |
# where <a id="#element"> corresponds to <div id="element"> | |
_onScrollToClick: -> | |
id = $(this).attr 'id' | |
$('html,body').animate {scrollTop: $(id).offset().top},400 |
OlderNewer