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
class MonadTest { | |
@Test | |
fun testMaybeMonad() { | |
val result = Maybe.unit(1) flatMap { | |
if (it > 0) Maybe.unit("Hello") else Maybe.None | |
} map { | |
"Hi, $it" | |
} map { | |
"$it ..." | |
} map { |
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
-- that is very similar to that of pandoc's HTML writer. | |
-- There is one new feature: code blocks marked with class 'dot' | |
-- are piped through graphviz and images are included in the HTML | |
-- output using 'data:' URLs. | |
-- | |
-- Invoke with: pandoc -t sample.lua | |
-- | |
-- Note: you need not have lua installed on your system to use this | |
-- custom writer. However, if you do have lua installed, you can | |
-- use it to test changes to the script. 'lua sample.lua' will |
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
-- that is very similar to that of pandoc's HTML writer. | |
-- There is one new feature: code blocks marked with class 'dot' | |
-- are piped through graphviz and images are included in the HTML | |
-- output using 'data:' URLs. | |
-- | |
-- Invoke with: pandoc -t sample.lua | |
-- | |
-- Note: you need not have lua installed on your system to use this | |
-- custom writer. However, if you do have lua installed, you can | |
-- use it to test changes to the script. 'lua sample.lua' will |
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
(ns beta-shop.view-util | |
(:use hiccup.core)) | |
(defmacro defpartial | |
[fname doc-or-args & body] | |
(if (string? doc-or-args) | |
(let [args# (first body) | |
fbody# (rest body)] | |
`(defn ~fname ~doc-or-args ~args# ~@fbody#)) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <uv.h> | |
static uv_buf_t | |
alloc_buffer(uv_handle_t *handle, size_t size) | |
{ | |
return uv_buf_init(malloc(size), size); | |
} |
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
#include <stdio.h> | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define TOY_MODULE_NAME "toy" |
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
require 'pathname' | |
require 'fileutils' | |
if ARGV.size < 3 | |
puts "Usage: ruby sign.rb App DeveloperId Provision" | |
exit | |
end | |
puts "Working" |