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
# | |
# CD Grabber. A simple Ruby script that simplifies converting your music to MP3 provided that you | |
# have Lame http://lame.sourceforge.net/ installed. | |
# | |
# Copyright (c) 2011 Anton Ivanov anton.al.ivanov(no spam)gmail.com | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
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
;Port of a simple unit testing framework from the "Practical Common Lisp" book to Clojure | |
;http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html | |
(ns cljunit-testing | |
(:require clojure.contrib.string)) | |
(defn function-names-from-stacktrace | |
"Returns a sequence of names of the user defined functions | |
obtained from the current Java stack trace" | |
[stackTrace] | |
(let [functionNames (map #(. %1 getClassName) stackTrace)] |
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
var lib = { | |
R: {} | |
}; | |
(function(host) { | |
function conj(element, arr, index) { | |
var arrCopy = arr.slice(index || 0); | |
arrCopy.unshift(element); | |
return arrCopy; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Array.splice Implementation</title> | |
<link rel="stylesheet" type="text/css" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" /> | |
<script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script> | |
<script type="text/javascript"> | |
if (!Array.prototype.splice2) { | |
Array.prototype.splice2 = function(index, howmany) { | |
if (index < 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
<!-- Hosted at http://pastehtml.com/view/bvmdpxu1r.html --> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Color Tool</title> | |
<style type="text/css"> | |
.colors-container { | |
width: 400px; | |
height: 200px; | |
padding: 16px; | |
border: 1px solid; |
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
<!-- Hosted at http://pastehtml.com/view/bwy9fiv68.html --> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Monte-Carlo Method</title> | |
<style type="text/css"> | |
.figure-container { | |
background-color: gray; | |
margin-bottom: 16px; | |
} | |
.figure { |
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
<!-- Hosted version http://pastehtml.com/view/c06ceb3bi.html --> | |
<html> | |
<header> | |
<style type="text/css"> | |
canvas { | |
background-color: black; | |
border-radius: 4px; | |
} | |
.drawing-area { | |
display: inline-block; |
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
//URL for a bookmarklet in a browser: | |
//javascript:var script = document.createElement("script"); script.src="https://raw.github.com/gist/3084823/6d8c6643e41092d09fa80c0db5234adbea7f94ea/mixup_page_animation.js"; document.body.appendChild(script);void(0); | |
(function(win) { | |
var elements = document.querySelectorAll("img, div"); | |
setInterval(function() { | |
for (var i = 0; i < elements.length; i++) { | |
elements[i].style.position = "fixed"; | |
elements[i].style.top = Math.floor(Math.random() * win.innerHeight).toString() + "px"; |
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
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<!-- Hosted at http://pastehtml.com/view/c50vk1exq.html --> | |
<head> | |
<meta charset="UTF-8"> | |
<title>15 puzzle</title> | |
<style type="text/css"> | |
.field { | |
width: 80%; | |
height: 80%; | |
max-width: 500px; |
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
//2012 Anton Ivanov anton.al.ivanov@gmail.com | |
//JavaScript memoization http://en.wikipedia.org/wiki/Memoization | |
(function (host) { | |
function memoize(func, host, hash) { | |
//By default memoize a function on the window object | |
var host = host || window, | |
hash = hash || {}, | |
original = host[func]; | |
//Only functions can be memoized |