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
const makeTrackFunc = mapObj => { | |
return f => { | |
return function(...args) { | |
const result = f.call(this, ...args); | |
mapObj.set(f, (mapObj.get(f) || []).concat({args, result})); | |
return result; | |
} | |
} | |
}; |
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
// Easy 249 | |
// https://www.reddit.com/r/dailyprogrammer/comments/40h9pd/20160111_challenge_249_easy_playing_the_stock/ | |
// node stocks_suggestion.js js 9.20 8.03 10.02 8.08 8.14 8.10 8.31 8.28 8.35 8.34 8.39 8.45 8.38 8.38 8.32 8.36 8.28 8.28 8.38 8.48 8.49 8.54 8.73 8.72 8.76 8.74 8.87 8.82 8.81 8.82 8.85 8.85 8.86 8.63 8.70 8.68 8.72 8.77 8.69 8.65 8.70 8.98 8.98 8.87 8.71 9.17 9.34 9.28 8.98 9.02 9.16 9.15 9.07 9.14 9.13 9.10 9.16 9.06 9.10 9.15 9.11 8.72 8.86 8.83 8.70 8.69 8.73 8.73 8.67 8.70 8.69 8.81 8.82 8.83 8.91 8.80 8.97 8.86 8.81 8.87 8.82 8.78 8.82 8.77 8.54 8.32 8.33 8.32 8.51 8.53 8.52 8.41 8.55 8.31 8.38 8.34 8.34 8.19 8.17 8.16 8.03 9.34 | |
function bestMargin(suggestion,other){ | |
if(suggestion === undefined) { | |
return other; | |
} | |
if(other.margin > suggestion.margin) { | |
return other; |
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> | |
<style> | |
@font-face { | |
font-family: 'std'; | |
src: url(data:font/truetype;charset=utf-8;base64,AAEAAAAOAIAAAwBgRkZUTVlJPI8AAADsAAAAHEdERUYA7gAEAAABCAAAACBPUy8yNTq5cgAAASgAAABgY21hcDskb/gAAAGIAAAB+mdhc3D//wABAAADhAAAAAhnbHlm7EEHWwAAA4wAADBcaGVhZAwFqW4AADPoAAAANmhoZWERAgfCAAA0IAAAACRobXR4AfcAAAAANEQAAAMEbG9jYY8gmyIAADdIAAABhG1heHAAxwAnAAA4zAAAACBuYW1lMIiEKwAAOOwAAANycG9zdMKGwlwAADxgAAACUXdlYmblIVZMAAA+tAAAAAYAAAABAAAAAMw9os8AAAAAupkEIAAAAADScpWfAAEAAAAOAAAAGAAAAAAAAgABAAEAwAABAAQAAAACAAAABAVTAZAAAAAEAQABAAAAAgABAAEAAAACAAEAAgAAAAIACAAAAgAEAAD3/67/+9///wgb//8AAAAAemVocgDAAA0l/AgA/wABAAgAAgAAAAABAAAAAAUABwAAAAAgAAEAAAADAAAAAwAAABwAAQAAAAAA9AADAAEAAAAcAAQA2AAAADIAIAAEABIADQB+AKEApwCtALoAzwDWAN0A7wD2AP0A/wEfAWEBeALGIAogFCAZIC8gXyCsJfz//wAAAA0AIACgAKMArQC6AL8A0QDYAN8A8QD4AP8BHgFhAXgCxiAAIBAgGSAvIF8grCX8////9v/k/8P/wv+9/7H/rf+s/6v/qv+p/6j/p/+J/0j/Mv3l4Kzgp+Cj4I7gX+AT2sQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBgAAAQAAAAAAAAABAgAAAAMAAAAAAAAAAAAAAAAA |
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> | |
<style> | |
body { | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; |
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
datatype json | |
= Array of json list | |
| Boolean of bool | |
| Float of real | |
| Integer of int | |
| Null | |
| Object of (json * json) list | |
| String of string |
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
# Quine Eval Server - An experiment | |
# ================================= | |
# | |
# This server, when run, will accept POST requests on the root ('/') where the post body is ruby code to eval. | |
# This server also makes a copy of its source code, and includes the eval'd statements in the new source. | |
# Because this is a sinatra server, you can use this to create new routes and build up a web service incrementally while running. | |
# | |
# Example post to server using curl: | |
# curl -vv -XPOST -d 'get "/hi" do ; "hi!" ; end' 'http://localhost:4567' | |
# |
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
let win = Curses.initscr ();; | |
Curses.nodelay win true;; | |
Curses.noecho ();; | |
let rec run () = | |
let inputCharCode = Curses.getch () in | |
let input = if inputCharCode >= 0 && inputCharCode <= 255 | |
then Some (Char.chr inputCharCode) | |
else None in | |
let couldWrite = match input with |
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 taggerSelectorCSSClass = "urx-tagger-selector"; | |
var taggerStyle; | |
var addStyle = function() { | |
taggerStyle = document.createElement("style"); | |
taggerStyle.innerHTML = "." + taggerSelectorCSSClass + " { background-color:green !important; color:white !important; border: 4px dashed white !important; }" + | |
"." + taggerSelectorCSSClass + " * { color: black !important; }"; | |
document.body.appendChild(taggerStyle); | |
}; |
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
package main | |
import ( | |
"fmt" | |
"github.com/samuel/go-zookeeper/zk" | |
"time" | |
) | |
func main() { | |
c, ech, err := zk.Connect([]string{"localhost"}, time.Minute) |
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
#!/bin/sh | |
# Copyright 2012 The Go Authors. All rights reserved. | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file. | |
# git gofmt pre-commit hook | |
# | |
# To use, store as .git/hooks/pre-commit inside your repository and make sure | |
# it has execute permissions. | |
# |
NewerOlder