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
| <html> | |
| <head> | |
| <style type="text/css"> | |
| #canvas { | |
| width: 200px; | |
| height: 200px; | |
| border: 1px dotted grey; | |
| } | |
| </style> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.3.10/d3.js" charset="utf-8"></script> |
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 elm, i, links = document.getElementsByTagName("a"); | |
| for (i = 0; i < links.length; i++) { | |
| elm = links.item(i); | |
| if (elm.href.match(".*\\.pdf$") && !elm.getAttribute("onClick")) { | |
| elm.addEventListener("click", (function (href) { | |
| return function (ev) { | |
| ev.preventDefault(); | |
| _gaq.push(function () { |
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 lcb(str) { | |
| var count = 0; | |
| return function() { | |
| console.log(Date() + "[ " + str + " ]" + " count: " + (count++)); | |
| } | |
| } |
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 _gaq = {}; | |
| _gaq.push = function () { | |
| var args = []; | |
| for (var i = 0; i < arguments.length; i++) { | |
| if (Array.isArray(arguments[i])) { | |
| args.push("[" + arguments[i].join(",") + "]"); | |
| } else { | |
| args.push(arguments[i].toString()); | |
| } | |
| } |
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 betterbox() { | |
| var boxes = $(".betterbox"); | |
| function reconcile() { | |
| var e = $(this); | |
| $("#" + e.attr("data-targid")).val(e.is(":checked") ? | |
| e.attr("data-yesval") : e.attr("data-noval")); | |
| } | |
| boxes.each(reconcile); | |
| // locate and save the target | |
| boxes.change(reconcile); |
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! DeployUpdate() | |
| argdo write | Gwrite | |
| Gcommit -m "Deploy-Update auto commit" | |
| Git push | |
| endfunction | |
| nnoremap <leader>d :call DeployUpdate()<cr> |
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
| .arenamenu { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| .arenamenu-item.level0 { | |
| /* display: inline; */ | |
| } |
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
| .arenamenu { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| .arenamenu-item.level0 { | |
| /* display: inline; */ | |
| } |
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
| val digits = (0 to 9).toList | |
| def without[A](l: List[A], r: List[A]) = | |
| l.filterNot(r.contains(_)) | |
| def makeNum(l: List[Int]): Int = | |
| l.reduce(_ * 10 + _) | |
| val res = | |
| for { |
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
| use strict; | |
| # simulate tail optimised recursion with goto | |
| sub rec1 { | |
| my $count = shift; | |
| say "-> rec1 ($count)"; | |
| if($count > 0) { $_[0] = $count - 1; goto &rec1; } | |
| # this doesn't get executed until the end : which so this sub wouldn't | |
| # normally be elligable for tail recursion optimisation (in the sense that | |
| # tail recursion here changes the execution behaviour). |
OlderNewer