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
store(Record) when not(is_list(Record))-> | |
store([Record]); | |
store(Records) when is_list(Records)-> | |
case mnesia:transaction(?FUN(lists:foreach(?FUN1(mnesia:write(X)), Records))) of | |
{atomic, ok} -> | |
ok; | |
_ -> | |
error | |
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
is_zero(0) -> true; | |
is_zero(_) -> false. |
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
is_zero(0) -> true; | |
is_zero(_) -> false. |
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
map(Fun, [], Acc) -> lists:reverse(Acc); | |
map(Fun, [H | T], Acc) -> | |
map(Fun, T, [Fun(H) | Acc]. |
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
map(Fun, [], Acc) -> lists:reverse(Acc); | |
map(Fun, [H | T], Acc) -> | |
map(Fun, T, [Fun(H) | Acc]). | |
map(fun(X) -> X + 1 end, [1,2,3], []). | |
[2,3,4] |
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
=ERROR REPORT==== 19-Jul-2011::11:13:52 === | |
** Generic server <0.32.0> terminating | |
** Last message in was {'EXIT',<0.34.0>,eio} | |
** When Server state == {state,user_sup,undefined,<0.34.0>, | |
{<0.32.0>,user_sup}} | |
** Reason for termination == | |
** eio |
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
<form data-bind="submit: save"> | |
First Name: <input type=text name=firstname data-bind="value: firstname" minlength=2 maxlength=25 class="required" /><br /> | |
Last Name: <input type=text name=lastname data-bind="value: lastname" minlength=2 maxlength=25 class="required" /><br /> | |
Username: <input type=text name=username data-bind="value: username" remote="/user/check" minlength=6 maxlength=25 class="required" /><br /> | |
Password: <input type=password id="password1" data-bind="value: password, uniqueName: true" minlength=8 class="required password" /><br /> | |
Retype Password: <input type=password data-bind="uniqueName: true" id="password1" equalto="#password1" class="required" /><br /> | |
Email Address: <input type=email name=email data-bind="value: email" remote="/user/email_check" class="required email" /><br /> | |
<input type=submit value="Save" id="saveSubmit" /> | |
</form> |
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 @User | |
firstname : ko.observable "" | |
lastname : ko.observable "" | |
email : ko.observable "" | |
username : ko.observable "" | |
password : ko.observable "" | |
save : -> | |
if $("form").validate().form() | |
$.post('/user', ko.toJSON(this), (data) -> window.location = "/login.html"; return false;).error () -> alert("error"); return false; |
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
def abv | |
out='' | |
n=`find #{to_s} -type f ! -name .DS_Store | wc -l`.to_i | |
out<<"#{n} files, " if n > 1 | |
out<<`/usr/bin/du -hd0 #{to_s} | cut -d"\t" -f1`.strip | |
end | |
Fixed for Linux: | |
def abv |
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
for x in `git branch -r | grep "origin/reviewable-" `; do git push ${x%/*} :${x#*/}; done |