Last active
November 12, 2015 04:35
-
-
Save dmitrinesterenko/6b0711365fb58855849a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Erlang format float with 2 decimal points | |
:io.format("~4.2f~n", [5.234]) | |
#Elixir environment variables | |
System.get_env | |
#Elixir one environment variable | |
System.get_env("USER") | |
#Elixir get functions for a module | |
File.__info__(:functions) | |
#Elixir get info for a file | |
File.lstat("media") | |
#Get a file extension | |
Path.extname('io.exs') | |
#Current pid | |
System.get_pid() | |
#Info about current processes | |
Process.info(Kernel.self) | |
@doc " | |
Get current folder where the process is running | |
# Uses :file.get_cwd Erlang | |
# | |
" | |
System.cwd() | |
@doc " | |
Example of using the group leader. | |
#In this case I'm outputting the string to the group leader process | |
" | |
IO.puts Process.group_leader, "Group leader speaking" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment