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(ants). | |
-export([main/1]). | |
-mode(compile). | |
readline_iterator(File) -> | |
fun() -> | |
case file:read_line(File) of | |
{ok, Line} -> {ok, Line, readline_iterator(File)}; | |
eof -> done; |
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
#!/bin/bash | |
node=$1 | |
data=($(echo $node | tr "@" "$IFS")) | |
username=yk | |
name=${data[0]} | |
domain=${data[1]} | |
rand=$(date +%s | sha256sum | base64 | head -c 10 ; echo) |
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(list_utils). | |
-export([group_by/2]). | |
group_by(_Key, []) -> []; | |
group_by(Key, List) -> | |
[H|T] = lists:keysort(Key, List), | |
K = element(Key, H), | |
group_by_(Key, K, [H], [], 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
-module(t). | |
-compile(export_all). | |
-record(r, {a1,a2,a3,a4,a5,a6,a7,a8}). | |
test(F, N, Times) -> | |
NSeq = lists:seq(1, N), | |
TimeSeq = lists:seq(1, Times), | |
R = |
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(dups). | |
-export([ | |
duplicates/1, | |
same_order_duplicates/1 | |
]). | |
duplicates([]) -> {[], []}; | |
duplicates(List) -> | |
[H|T] = lists:sort(List), |
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
0 at [1, 1] | |
1 at [1, 5] | |
2 at [1, 9] | |
3 at [1, 13] | |
4 at [1, 17] | |
5 at [1, 21] | |
6 at [1, 25] | |
7 at [1, 29] | |
8 at [1, 33] | |
9 at [1, 37] |
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
#!/usr/bin/env escript | |
-mode(compile). | |
-define(M0, {0, ["111","101","101","101","111"]}). | |
-define(M1, {1, ["110","010","010","010","111"]}). | |
-define(M2, {2, ["111","001","111","100","111"]}). | |
-define(M3, {3, ["111","001","111","001","111"]}). | |
-define(M4, {4, ["101","101","111","001","001"]}). | |
-define(M5, {5, ["111","100","111","001","111"]}). |
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(pub_sub). | |
-export([ | |
sub/1, | |
sub/2, | |
pub/2 | |
]). | |
sub(Property) -> | |
sub(Property, self()). |
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
#!/bin/bash | |
zypper rm `zypper se -si 'kernel*' | grep kernel | awk '{printf("%s-%s\n",$3,$7)}' | grep -v $1 | tr "\\n" " " ` |
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> | |
<title>Test remember password</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('#login-button').click(function (ev) { | |
alert('AJAX login...'); | |
}); |
NewerOlder