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/sh | |
ROOTDIR=`which erl | sed -ne '/^ROOTDIR=/s///p'` | |
find $ROOTDIR -name $1.erl | awk -F / '{print $(NF-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
#!/usr/bin/env escript | |
-mode(compile). | |
epoch() -> | |
{Mega,Sec,Mili} = os:timestamp(), | |
(Mega * 1000000) + Sec + (Mili / 1000000). | |
measure(F) -> | |
Ini = epoch(), |
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(slugs). | |
-export([slugify/1]). | |
-define(tolower(C), (C+32)). | |
-define(islower(C), (C >= $a andalso C =< $z)). | |
-define(isupper(C), (C >= $A andalso C =< $Z)). | |
-define(isdigit(C), (C >= $1 andalso C =< $9)). | |
-define(isspace(C), ( | |
C =:= $\s orelse C =:= $\n orelse C =:= $\t orelse C =:= $\r |