Skip to content

Instantly share code, notes, and snippets.

View marvinthepa's full-sized avatar

Martin Sander marvinthepa

  • Europe
View GitHub Profile
(function() {
toggleQuickFilter = GH.Components.QuickFilters.prototype.toggleQuickFilter;
GH.Components.QuickFilters.prototype.toggleQuickFilter = function(event, button) {
var title = $(button).attr('title');
if (!$(button).hasClass('ghx-active') && title !== undefined && title.match(/RADIOBUTTON/)) {
GH.Components.QuickFilters.prototype.clearFilters();
}
toggleQuickFilter.apply(this, Array.prototype.slice.call(arguments));
};
}());
@marvinthepa
marvinthepa / gist:884258
Created March 23, 2011 23:30
Script to get repository statistics clojure-scala-groovy from github
;; project.clj
;(defproject github-stat "0.0.1-SNAPSHOT"
; :dependencies [[clojure "1.2.0"]
; [clojure-contrib "1.2.0"]
; [clj-http "0.1.3"]
; [incanter "1.2.3"]])
(ns github.fun
(:use clojure.contrib.json clojure.contrib.pprint
[incanter core stats charts])
@marvinthepa
marvinthepa / blades.clj
Created April 18, 2011 21:00
Number of blades on a safety razor, over time
(ns blades
(:use [incanter core stats charts])
(:import java.text.SimpleDateFormat))
(def dates
{"first one-bladed gilette safety razor, 1" 1888
"Trac II" 1971
"Mach3" 1998
"Wilkinson Quattro" 2003
"Fusion" 2006
@marvinthepa
marvinthepa / gist:6243971
Last active December 21, 2015 03:39
Functional Hipsters don't like for loops
;; using clojures included batteries
(reduce
(partial
merge-with (fn [x y] (if (seq? x) (conj x y) [x y])))
[{:en "en1" :de "de"} {:en "en2" :de "de2"}])
;; even easier if we already have vectors as values
(reduce
(partial merge-with concat)
[{:en ["en1"] :de ["de"]} {:en ["en2"] :de ["de2"]}])