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
func httpRequestHandler(w http.ResponseWriter, req *http.Request) { | |
err := func () os.Error { | |
if req.Method != "GET" { | |
return os.NewError("expected GET") | |
} | |
if input := parseInput(req); input != "command" { | |
return os.NewError("malformed command") |
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
//------------------------------------------------------------------------------ | |
// Remove class by Regex | |
// Array.filter for IE<9: https://gist.github.com/eliperelman/1031656 | |
[].filter||(Array.prototype.filter=function(a,b,c,d,e){c=this;d=[];for(e in c)~~e+''==e&&e>=0&&a.call(b,c[e],+e,c)&&d.push(c[e]);return d}); | |
// http://stackoverflow.com/a/18621161 | |
$.fn.removeClassRegex = function(regex) { | |
return $(this).removeClass(function(index, classes) { | |
return classes.split(/\s+/).filter(function(c) { |
NewerOlder