Skip to content

Instantly share code, notes, and snippets.

(defn get-chars-at [seq count]
(reduce (fn [accum next]
(let [next-char (get next count)
char (if-not (nil? next-char) next-char " ")]
(str accum char)))
"" seq))
(defn max-count [seq]
(reduce (fn max-count [last line]
(let [c (count line)]
<!doctype html>
<html>
<head>
<link href="bootstrap.css" rel="stylesheet"/>
<style>
#expanded:target .nav-collapse {
height: auto;
}
.navbar .btn-contract {
display: none;
<!doctype html>
<html>
<head>
<link href="bootstrap.css" rel="stylesheet"/>
<style>
#expanded:target .nav-collapse {
height: auto;
}
</style>
</head>
<body id="expanded">
<div class="navbar">
<div class="navbar-inner">
<a class="btn btn-navbar btn-expand" href="#expand">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
var module = (function () {
var hash = {};
function fetch (name) {
return hash[name];
}
fetch.create = function (name, thing) {
if (name in hash) {
<!doctype html>
<script>
(function () {
var id = 'sendhack';
function sendPost(url, data) {
var iframe = document.createElement('iframe');
function times(first, second) {
return first * second;
}
console.log(times(3, 4)); // 12
console.log(times(10, 50)); // 500
console.log(times); // function () {}
function Animal (name, numLegs) {
this.name = name;
this.numLegs = numLegs;
}
Animal.prototype.greet = function () {
console.log("Hi! My name is " + this.name);
}
function Horse (name) {
define(['hashmap'], function (HashMap) {
describe('HashMap', function () {
var hash;
function size (obj) {
var size = 0;
for (var key in obj) {
if (obj.hasOwnProperty(key)) size++;
function HashMap() { this.data = []; }
HashMap.prototype.hash = function (val) {
var i = 0;
var d = ('' + val).split('');
var l = d.length;
var t = 0;
while(i < l) {
t += d[i].charCodeAt();
i++;