You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/articles/round-1-day-1.md
+36-31Lines changed: 36 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,62 +9,67 @@ devToId: 602094
9
9
---
10
10
11
11
## TIL
12
-
Currently during the 100DaysOfCode Challenge, I'm learning elixir. I'll be documenting everything I learn or build as I go. I'm starting off with learning the elixir basics at [ElixirSchool](http://elixirschool.com).
13
-
12
+
13
+
Currently, during the 100DaysOfCode Challenge, I'm learning elixir. I'll be documenting everything I learn or build as I go. I'm starting off with learning the elixir basics at [ElixirSchool](http://elixirschool.com).
14
+
14
15
## Basics
16
+
15
17
- Everything is truthy except for `false` and `nil`
16
18
- Booleans are atoms (:true, :false)
17
-
- Modules are atoms
19
+
- Modules are atoms
18
20
- You can access erlang libraries using atoms
19
-
- Aka atoms are important :)
21
+
- Aka atoms are important :)
20
22
- Strings use double quotes
21
23
- No modulo operator, but there are the `div` and `rem` functions.
22
-
- Each basic type has a rank :/
23
-
- number < atom < reference < function < port < pid < tuple < map < list < bistring
24
-
- I'll never memorize this lawl
24
+
- Each basic type has a rank :/
25
+
- number < atom < reference < function < port < pid < tuple < map < list < bistring
> In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence.
33
-
- List concat `++/2` - cool
34
-
- List sub `--/2` - cool cool
35
-
- Head/Tail - cool cool cool
36
-
- By pattern matching `[head | tail] = list` #=> head is the first element. tail will be all the others
37
-
-`hd list` #=> returns the first element
38
-
-`tl list` #=> returns all elements after the first
32
+
- Mixed types
33
+
- Not unique
34
+
- Linked List → faster to prepend than append
35
+
> In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes that together represent a sequence.
36
+
- List concat `++/2` - cool
37
+
- List sub `--/2` - cool cool
38
+
- Head/Tail - cool cool cool
39
+
- By pattern matching `[head | tail] = list` #=> head is the first element. the tail will be all the others
40
+
-`hd list` #=> returns the first element
41
+
-`tl list` #=> returns all elements after the first
39
42
- Tuples
40
-
- Stored with a set amount of memory
41
-
- Access = fast; modification = slow
42
-
- Common for return info from function
43
+
- Stored with a set amount of memory
44
+
- Access = fast; modification = slow
45
+
- Common for return info from function
43
46
- Keyword lists
44
-
- commonly used to pass options to functions
47
+
- commonly used to pass options to functions
45
48
- Maps
46
-
- The Go-to key-value store
47
-
- Similar to ruby's hash
48
-
- Updating syntax is cool?
49
-
- useMap.put/3 to create a new key
49
+
- The Go-to key-value store
50
+
- Similar to ruby's hash
51
+
- Updating syntax is cool?
52
+
- useMap.put/3 to create a new key
50
53
51
54
## Enum
55
+
52
56
- Not much to go over here if you are familiar with any other languages Enum methods
53
57
54
58
## Pattern Matching
59
+
55
60
- The Holy Grail of Elixir
56
61
- If you ask any dev what they love about elixir chances are they will mention pattern matching
57
-
- Curveball `=` is actually a match operator similar to the equals sign in algebra :exploading-head:
62
+
- Curveball `=` is actually a match operator similar to the equals sign in algebra :exploding-head:
58
63
-[1| tail] = list #=> tail has not been matched so it binds to the last elements of the list
59
64
60
65
## Control Structures
61
66
62
67
-`if` and `unless` => straight forward
63
68
-`case/2`
64
-
- Similar to `switch`(in javascript) or `case` (ruby) except it uses pattern matching
65
-
-`_` is a catch all like `default` in JavaScript
69
+
- Similar to `switch`(in javascript) or `case` (ruby) except it uses pattern matching
70
+
-`_` is a catch all like `default` in JavaScript
66
71
-`Cond`
67
-
- Used for matching multiple cases similar to an `else if`
72
+
- Used for matching multiple cases similar to an `else if`
68
73
-`With`
69
-
- This one is bit trickier coming from other languages
70
-
- Can be used to replace multiple `case` statements
74
+
- This one is bit trickier coming from other languages
75
+
- Can be used to replace multiple `case` statements
Three days ago I started the #100DaysOfCode Challenge, and today I finished elixirschool.com basics for elixir. This feels great because I started those basics over a year ago and stopped.
13
+
14
+
Quick TL;DR; for today.
15
+
16
+
## Testing
17
+
18
+
- ExUnit is built in to elixir, so I'll prolly be using that for my testing framework.
19
+
- Test Mocks. The elixir community has an interesting take on mocking. The whole idea revolves around using "mocks" as a noun and not a verb. The concept is to keep parts of the code isolated and easier to test.
20
+
- If you want to read more, check out the original blog post (here)[http://blog.plataformatec.com.br/2015/10/mocks-and-explicit-contracts/]
21
+
22
+
## Comprehensions
23
+
24
+
- Generators:
25
+
- are neato
26
+
- multiple generators can be used at a time
27
+
- Filters can be added to generators as you iterate over an Enum
Copy file name to clipboardExpand all lines: content/articles/using-github-to-crosspost-to-dev-to.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The internet is much like a forest with content and sites being like trees. Ther
15
15
16
16
<br>
17
17
18
-
Over the last 6 years of Software Development, I've learned a lot, but I've never shared it outside of my full-time job. If there's not an easy way for people to find the blogs I put out, then I'm still not sharing my thoughts with others. This is where sites like [dev.to](https://dev.to/basicbrogrammer) and [hashnode](https://hashnode.com/@basicbrogrammer) come into play. I can write the markdown for my blog posts in vim then crosspost to other blog distribution platforms. I definitely didn't want to copypasta all my content every time, so I've decided to automate this process and open-source it.
18
+
Over the last 6 years of Software Development, I've learned a lot, but I've never shared it outside of my full-time job. If there's not an easy way for people to find the blogs I put out, then I'm still not sharing my thoughts with others. This is where sites like [dev.to](https://dev.to/basicbrogrammer) and [hashnode](https://hashnode.com/@basicbrogrammer) come into play. I can write the markdown for my blog posts in vim then crosspost to other blog distribution platforms. I definitely didn't want to copypasta all my content every time, so I've decided to automate this process and open-source it.
0 commit comments