Language | ||||||||
---|---|---|---|---|---|---|---|---|
Common Lisp | mapc | mapcar | find-if | remove-if-not | reduce | reduce :from-end t | some | every |
Scheme | for-each | map | find | filter | fold, fold-left | fold-right | any, exists | every, for-all |
Haskell | mapM_ | map | find | filter | foldl | foldr | any | all |
Caml Light | do_list | map | - | - | it_list | list_it | exists | for_all |
OCaml | iter | map | find | filter, find_all | fold_left | fold_right | exists | for_all |
F# | iter | map | find | filter | fold | foldBack | exists | forall |
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
// ==UserScript== | |
// @name million live | |
// @include http://app.ip.bn765.com/app/index.php/* | |
// @include http://imas.gree-apps.net/app/index.php/* | |
// ==/UserScript== | |
var script = document.createElement('script'); | |
var f = function() { | |
var handler = function(e) { | |
if (!e.ctrlKey) return; |
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
trait EnumLike { | |
type Value | |
def value: Value | |
} | |
trait StringEnumLike extends EnumLike { | |
type Value = 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
# -*- coding: utf-8 -*- | |
def cmd(target, pane, remote_command) | |
command = "tmux send-keys -t:#{target}.#{pane} #{remote_command} C-m" | |
system command | |
end | |
def window(window_name) | |
system "tmux new-window -a -n #{window_name}" | |
end |
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
(* | |
OCaml translation of the ideas explained in http://fumieval.hatenablog.com/entry/2014/09/22/144401 | |
To emulate the higher kinded polymorphism, the technique used explained in https://ocamllabs.github.io/higher/lightweight-higher-kinded-polymorphism.pdf | |
*) | |
module StateMonad = struct | |
type ('s, 'a) m = 's -> 's * 'a |
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
import enumlike.{EnumCompanionBase, EnumLike} | |
import scalikejdbc._ | |
trait ScalikeJDBCEnumCompanion { | |
self: EnumCompanionBase => | |
implicit def optionalTypeBinder(implicit ev: TypeBinder[EnumLikeType#ValueType]): TypeBinder[Option[A]] = ev.map(valueOf) | |
implicit def typeBinder(implicit ev: TypeBinder[EnumLikeType#ValueType]): TypeBinder[A] = optionalTypeBinder(ev).map(_.get) | |
} |