This commit is contained in:
Rico Sta. Cruz 2016-06-29 12:29:13 +08:00
parent f33fb9da78
commit 817ce75db1
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
2 changed files with 38 additions and 12 deletions

38
ets.md Normal file
View File

@ -0,0 +1,38 @@
---
title: Erlang ETS
category: Elixir
---
```elixir
iex> table = :ets.new(:my_table)
8211
iex> :ets.insert(table, {:fruit, "Apple"})
iex> :ets.lookup(table, :fruit)
[{:fruit, "Apple"}]
iex> :ets.delete(table)
```
### Flags
```
iex> table = :ets.new(:my_table, [:set, :protected])
```
- `:set` - no duplicate keys (or: `:ordered_set`, `:bag`, `:duplicate_bag`)
- `:protected` - only this process can use it (or: `:public`, `:private`)
### Other functions
```elixir
# Ordered sets
:ets.first(table)
:ets.last(table)
:ets.next(table, key)
:ets.prev(table, key)
```
## References
* <http://erlang.org/doc/man/ets.html>

View File

@ -89,18 +89,6 @@ category: Devops
heroku domains:clear
heroku domains:remove example.com
### DNS records
# Root domains
mydomain.com. (A)
=> 75.101.163.44
=> 75.101.145.87
=> 174.129.212.2
# Subdomains
.mydomain.com. (CNAME)
=> proxy.heroku.com
### Wildcard domains
heroku addons:add wildcard_domains