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> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" /> | |
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<style type="text/css"> |
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> | |
<meta charset="UTF-8"> | |
<title>Mechanical Grass · CodePen</title> | |
<!-- | |
Copyright (c) 2012 Tim Holman, http://codepen.io/tholman | |
Permission is hereby granted, free of charge, to any person obtaining |
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> | |
<meta charset="UTF-8"> | |
<title>CodePen · Pen</title> | |
<!-- | |
Copyright (c) 2012 Mahroof Ali, http://codepen.io/anon | |
Permission is hereby granted, free of charge, to any person obtaining |
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 filename, _fn, _i, _len; | |
_fn = function(filename) { | |
return fs.readFile(filename, function(err, contents) { | |
return compile(filename, contents.toString()); | |
}); | |
}; | |
for (_i = 0, _len = list.length; _i < _len; _i++) { | |
filename = list[_i]; | |
_fn(filename); |
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
-module(fib). | |
-export([fib/1]). | |
-include_lib("eunit/include/eunit.hrl"). | |
%% this call a undef function in erlang module | |
fib(a) -> erlang:lists_to_atom("a"); | |
fib(0) -> 1; | |
fib(1) -> 1; | |
fib(N) when N > 1 -> fib(N-1) + fib(N-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
-module(xxx_sup_spawn_test). | |
-include_lib("eunit/include/eunit.hrl"). | |
test_1_() -> {spawn, { | |
setup, | |
fun setup/0, | |
[ | |
?_assert(is_pid(whereis(xxx_sup))), | |
] | |
}}. |
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
-module(db). | |
-export([new/0, destroy/1, write/3, delete/2, read/2, match/2]). | |
new() -> []. | |
destroy(_Db) -> successful. | |
write(Key, Val, Db) -> [{Key, Val} | Db]. | |
delete(_Key, []) -> []; | |
delete(Key, [{HK, _}|T]) when Key == HK -> delete(Key, T); |
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
get_timestamp() -> | |
T1 = calendar:datetime_to_gregorian_seconds(erlang:localtime()), | |
T2 = calendar:datetime_to_gregorian_seconds({{1970, 1, 1}, {0, 0, 0}}), | |
T1 - T2. |
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
-module(test). | |
NewerOlder