Skip to content

Instantly share code, notes, and snippets.

View Kah0ona's full-sized avatar

Marten Sytema Kah0ona

View GitHub Profile
@Kah0ona
Kah0ona / testcase.clj
Created July 25, 2016 12:33
Testcase addition for url encoding.
(deftest complex-params-to-str
; other clauses.
(is (= "d=b%20c" (params-to-str {"d" "b c"})))
(is (= "d=b%20%26%20c" (params-to-str {"d" "b & c"}))))
@Kah0ona
Kah0ona / Solving 24 flippo's
Created March 2, 2015 19:36
solve a flippo by using t [2,2,7,1]
import Data.List
t :: [Double] -> [[Char]]
t f =
let
perms = permutations f
opers = [("+", (+)), ("-", (-)), ("*", (*)), ("/" ,(/))]
in
["(((" ++ (show $ truncate a) ++ n1 ++ (show $ truncate b) ++ ")" ++ n2 ++ (show $ truncate c) ++ ")" ++ n3 ++ (show $ truncate d) ++ ")" |
[a ,b ,c ,d ] <- perms,
jQuery(document).ready(function($){
$('.tabs').click(function(evt){
evt.preventDefault();
$('.tabtargets').hide();
var clicked = $(evt.currentTarget);
var toShow = clicked.attr('data-target');
$(toShow).show();
});