File tree Expand file tree Collapse file tree 6 files changed +64
-2
lines changed Expand file tree Collapse file tree 6 files changed +64
-2
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,8 @@ allow reusability as much as possible. Mostly useful for frontend design.
11
11
- ...
12
12
13
13
Source: [ Brad Frost] ( https://bradfrost.com/blog/post/atomic-web-design/ )
14
+
15
+ ## Coding style
16
+
17
+ At the linux kernel guideline are some good advices: [ The linux kernel - coding style] ( https://www.kernel.org/doc/html/v4.10/process/coding-style.html#linux-kernel-coding-style )
18
+ Google have some [ guidelines] ( https://google.github.io/styleguide/ ) for some languages as well.
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ Source: [markodenic](https://markodenic.com/use-console-log-like-a-pro/)
43
43
44
44
## React location listener
45
45
46
- To trigger event son laction change in React:
46
+ To trigger events on location change in React, i.e. for integrate tracking code :
47
47
48
48
``` js
49
49
import { useEffect } from ' react' ;
Original file line number Diff line number Diff line change @@ -22,6 +22,28 @@ Learning from some youtube guys:
22
22
- Some great articles about coding [ johnnunemaker] ( https://www.johnnunemaker.com/ )
23
23
- rails, ruby, ...
24
24
25
+ ## Data class
26
+
27
+ Similiar to the [ value-alike objects] ( https://docs.ruby-lang.org/en/master/Data.html ) in ruby(3.2), here an example for rails:
28
+
29
+ ``` ruby
30
+ class DataClass
31
+ ATTRIBUTES = %i[first_name last_name city zipcode phone_number] .freeze
32
+
33
+ include ActiveModel ::Model
34
+
35
+ attr_accessor * ATTRIBUTES
36
+
37
+ def == (object )
38
+ ATTRIBUTES .all? { |attribute | public_send(attribute) == object.public_send(attribute) }
39
+ end
40
+ end
41
+
42
+ ConsumerClass .new (DataClass ({first_name: " Bill" , last_name: " ..." , ...}))
43
+ ```
44
+
45
+ Links: [ Polyfill - Data gem] ( https://github.com/saturnflyer/polyfill-data )
46
+
25
47
## RSpec factory trait & transient
26
48
27
49
``` ruby
Original file line number Diff line number Diff line change @@ -87,4 +87,35 @@ IP_REGEX = /
87
87
}
88
88
# => true
89
89
```
90
- Source: [ dev.to/baweaver] ( https://dev.to/baweaver/pattern-matching-interfaces-in-ruby-1b15 )
90
+ Source: [ dev.to/baweaver] ( https://dev.to/baweaver/pattern-matching-interfaces-in-ruby-1b15 )
91
+
92
+ ## Refinement
93
+
94
+ Extend/overwrite string behavior in module (specific scope)
95
+
96
+ ``` ruby
97
+ module PatchedString
98
+ refine String do
99
+ def + (value )
100
+ self << " , #{ value } "
101
+ end
102
+ end
103
+ end
104
+
105
+ module RegularNamespace
106
+ def self .append_strings (a , b )
107
+ a + b
108
+ end
109
+ end
110
+
111
+ module PatchedNamespace
112
+ using PatchedString
113
+
114
+ def self .append_strings (a , b )
115
+ a + b
116
+ end
117
+ end
118
+
119
+ RegularNamespace .append_strings(" 1" , " 2" ) # => "12"
120
+ PatchedNamespace .append_strings(" 1" , " 2" ) # => "1, 2"
121
+ ```
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.Networks.
30
30
31
31
Show the model in shell ` cat /sys/firmware/devicetree/base/model `
32
32
33
+ ### Kubernetes
34
+
35
+ Some security [ guidelines for kubernetes (OWASP)] ( https://sysdig.com/blog/top-owasp-kubernetes/ )
36
+
33
37
### SSH
34
38
35
39
#### Articles
You can’t perform that action at this time.
0 commit comments