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
qsort :: [Int] -> [Int] | |
qsort [] = [] | |
qsort (x:xs) = qsort [y | y <- xs, y < x] ++ [x] ++ qsort [y | y <- xs, y >= x] |
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
-- ax^2 + bx + c = 0 | |
qEquation :: (Float, Float, Float) -> (Float, Float) | |
qEquation (a, b, c) = (x1, x2) | |
where | |
x1 = e + sqrt d / (2 * a) | |
x2 = e - sqrt d / (2 * a) | |
d = b * b - 4 * a * c | |
e = - b / (2 * a) |
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
<!DOCTYPE html> | |
<title>HTML rockt!</title> | |
<p>Hello world</p> |
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
RewriteEngine on | |
RewriteCond %{HTTP_HOST} !^www.domain.tld$ | |
RewriteRule ^(.*)$ http://www.domain.tld/$1 [L,R=301] |
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
// http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript | |
(function($) { | |
var cache = []; | |
// Arguments are image paths relative to the current page. | |
$.preLoadImages = function() { | |
var args_len = arguments.length; | |
for (var i = args_len; i--;) { | |
var cacheImage = document.createElement('img'); | |
cacheImage.src = arguments[i]; |
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
$('a').click(function () { | |
window.open(this.href); | |
return false; | |
}); |
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
/*jslint white: true, onevar: true, browser: true, undef: true, nomen: true, regexp: true, plusplus: true, bitwise: true, newcap: true, strict: true, maxerr: 50, indent: 4 */ | |
/*globals $ */ | |
"use strict"; |
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
/*jshint jquery: true, browser: true, bitwise: true, curly: true, eqeqeq: true, noempty: true, onevar: true, plusplus: true, undef: true, strict: true, white: true */ |
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 xPos; | |
$(yourElement).bind('touchstart mousedown', function (event) { | |
event.preventDefault(); | |
if (event.type == 'touchstart') { | |
xPos = event.originalEvent.targetTouches[0].layerX; | |
} else { | |
xPos = event.originalEvent.layerX; | |
} | |
} |