Queries
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
watch: { | |
// ... | |
less: { | |
files: 'less/*.less', | |
// tasks: 'less', | |
tasks: ['less', 'save-support-file'] | |
} | |
} | |
// ... |
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
<?xml version="1.0"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:control="lisa:ControlInfo" xmlns:lisa="lisa:XsltExtensions" exclude-result-prefixes="lisa control"> | |
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/> | |
<xsl:param name="query-string"/> | |
<xsl:param name="NewsPageId"/> | |
<xsl:variable name="newsid" select="$query-string/param[@name = 'NewsId']" /> | |
<xsl:template match="News"> | |
<xsl:for-each select="Item"> | |
<xsl:sort select="Start" order="ascending"/> | |
<xsl:if test="NewsItemId = $newsid"> |
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
<?php | |
function vol_price ($needed) { | |
$table = array( | |
array(250, 0.90), | |
array(330, 1.30), | |
array(500, 2.20), | |
array(1000, 2.50), | |
array(1500, 3.00), |
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
function tree(w) { | |
return "\n" + Array.apply(null, Array(w)).map(function (_, x) { | |
return Array.apply(null, Array(w*2)).map(function (_, y) { | |
if (y === w-x && x === 0) return 'X'; | |
if (y > (w-x) && y < (w+x)) return (Math.random() > 0.7) ? '@' : '.'; | |
return (y === w-x) ? '/' : ((y === w+x) ? '\\' : ' '); | |
}).join(''); | |
}).join("\n"); | |
} |
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
/** | |
* Circulate santas saying merry christmas to each other | |
* @param int Numer of santas | |
* @return String | |
*/ | |
function santaSaidMerryChristmas(n) { | |
// vars | |
var santas = Array.apply(null, Array(n)).map(function (_, i) { return (i + 1); }), | |
i = 0; |
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
// HTTP 200 www.foo.is /ord | |
// paste in console | |
var words = document.body.children[0].innerText.toLowerCase().split("\n"), | |
count = 0; | |
for (var i = 0; i < words.length; i++) { | |
for (var p = Math.floor(words[i].length / 2); p >= 0; p--) { | |
if (words[i][p] !== words[i][words[i].length - p - 1]) break; | |
if (p === 0) count++; |
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
81 | |
2.025 | |
3.025 | |
9.801 | |
494.209 | |
998.001 | |
24.502.500 | |
25.502.500 | |
52.881.984 | |
60.481.729 |
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
// get factorial by iteration (faster than recursive) | |
Math.factorial = function (n) { | |
var a = 1; | |
for (var i = 2; i < n; i++) { | |
a *= i; | |
} | |
return a; | |
} | |
// setup test case |
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
// HTTP 200 www.foo.is /ord | |
// paste in console | |
// parameters | |
var singles = 'hbcnofpskvyiwu'.split(''), | |
doubles = 'helibenenamgalsiclarcascticrmnfeconicuzngageassebrkrrbsrzrnbmotcrurhpdagcdinsnsbtexecsbalaceprndpmsmeugdtbdyhoertmybluhftareosirptauhgtlpbbipoatrnfrraacthpanppuamcmbkcfesfmmdnolrrfdbsgbhhsmt'.match(/.{1,2}/g), | |
elements = singles.concat(doubles), | |
words = document.querySelector('pre').innerHTML.split('\n'); | |
// sort words by length |
OlderNewer