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
defmodule Plural do | |
require Record | |
Record.defrecordp :xmlAttribute, Record.extract(:xmlAttribute, from_lib: "xmerl/include/xmerl.hrl") | |
Record.defrecordp :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl") | |
defmacro __using__(_env) do | |
quote do | |
@before_compile Plural | |
Module.register_attribute(__MODULE__, :plurals, accumulate: true) |
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
LANG=en | |
This is a comment that precedes the strings. | |
@test message | |
Hello from the translator. | |
-- and this is a comment inbetween strings | |
@test message 2 |
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
# current | |
("You came in " <> case(plural("en", :ordinal, args[:place])) do | |
"few" -> | |
to_string(args[:place]) <> "rd" | |
"one" -> | |
to_string(args[:place]) <> "st" | |
"other" -> | |
to_string(args[:place]) <> "th" | |
"two" -> | |
to_string(args[:place]) <> "nd" |
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 functions = { | |
add: function (args) { | |
return args.reduce(function (a, b) { return a + b }); | |
}, | |
twoarg: function (a, b) { | |
return a * b; | |
}, | |
async: function (a, cb) { | |
var state = this.state; | |
setTimeout(function () { |
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
defmodule MyApp.UserResource do | |
use Phoenix.Resource | |
defp get_user(%{"id" => id}) do | |
Repo.get(User, id) | |
end | |
def supported_formats do | |
["html", "json", "xml"] | |
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
defmodule WrangleTest.Disabled do | |
use Wrangle | |
plug :serve | |
decide :service_available?, do: false | |
end | |
# compiled decision tree |
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
defp(do_decide(:accept_charset_exists?, var!(conn))) do | |
if(has_header(var!(conn), "accept-charset")) do | |
case(handle_decision(var!(conn), ( | |
charset = ConNeg.find_best(:charset, var!(conn).assigns().headers()["accept-charset"], @available_charsets) | |
{!is_nil(charset), assign(var!(conn), :charset, charset)} | |
))) do | |
{true, var!(conn)} -> | |
do_decide(:if_match_exists?, var!(conn)) | |
{false, var!(conn)} -> | |
do_decide(:handle_not_acceptable, var!(conn)) |
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 Tween = (function () { | |
var animations = {}, nanim = 0; | |
var Tween = {}; | |
Tween.step = function () { | |
var d = new Date(); | |
var thisTick = d.getTime(); | |
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<script type="text/javascript" src="Eventful.js"></script> | |
<script type="text/javascript" src="Mustache.js"></script> | |
</head> | |
<body> | |
<div style="float: left; margin-right: 30px;"> | |
<h2>Object Definition</h2> | |
<pre> var Person = function (name) { |
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
<html> | |
<head> | |
<script type="text/javascript" src="src/Server.js"></script> | |
<script type="text/javascript" src="src/Cursor.js"></script> | |
<script type="text/javascript" src="src/Collection.js"></script> | |
<script type="text/javascript" src="src/Db.js"></script> | |
</head> | |
<body> | |
| |
<script type="text/javascript"> |
OlderNewer