Skip to content

Instantly share code, notes, and snippets.

View mkovacek's full-sized avatar
🇭🇷

Matija Kovaček mkovacek

🇭🇷
View GitHub Profile
@mkovacek
mkovacek / clean_code.md
Last active December 31, 2021 08:48 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ core.wcm.components.angular.examples.spa-components ---
[INFO] Running 'npm install' in /Users/matija.kovacek/development/aem-angular-core-wcm-components/examples/angular-spacomponents-example-project
[WARNING] npm WARN checkPermissions Missing write access to /Users/matija.kovacek/development/aem-angular-core-wcm-components/examples/angular-spacomponents-example-project/node_modules/@adobe/aem-core-components-angular-base
[WARNING] npm WARN checkPermissions Missing write access to /Users/matija.kovacek/development/aem-angular-core-wcm-components/examples/angular-spacomponents-example-project/node_modules/@adobe/aem-core-components-angular-spa
[WARNING] npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN [email protected] requires a peer of
@mkovacek
mkovacek / akamaicachepurge.sh
Created February 7, 2021 08:26 — forked from marutiprasad/akamaicachepurge.sh
Akamai purge in the event of dispatcher / local cache purge
#!/bin/sh
# Before running this script, plese ensure the following tools are installed.
# 1. inotifywait (yum install inotify-tools)
# 2. akamai-purge (script https://github.com/akamai/cli-purge)
# 3. Keep the CCU API credentials in the .edgerc file in the user home dir.
ROOTDIR='/data/www/htdocs/publish/content/site1'
HOST_URL='https://www.myhost.com'
inotifywait -m -r -e delete $ROOTDIR |
while read dir ev file; do
Run powershell as administrator:
-posh-gvm installation:
Execute (new-object Net.WebClient).DownloadString('https://raw.githubusercontent.com/flofreud/posh-gvm/master/GetPoshGvm.ps1') | iex
Execute Import-Module posh-gvm
// if you have problems with execution policy (https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Core/about/about_Execution_Policies)
// Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
// later return to old value
Execute gvm help to get started!
-sdkman installation:
Run powershell as administrator:
-posh-gvm installation:
Execute (new-object Net.WebClient).DownloadString('https://raw.githubusercontent.com/flofreud/posh-gvm/master/GetPoshGvm.ps1') | iex
Execute Import-Module posh-gvm
// if you have problems with execution policy (https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Core/about/about_Execution_Policies)
// Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
// later return to old value
Execute gvm help to get started!
-sdkman installation:
Run powershell as administrator:
-posh-gvm installation:
Execute (new-object Net.WebClient).DownloadString('https://raw.githubusercontent.com/flofreud/posh-gvm/master/GetPoshGvm.ps1') | iex
Execute Import-Module posh-gvm
// if you have problems with execution policy (https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Core/about/about_Execution_Policies)
// Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
// later return to old value
Execute gvm help to get started!
-sdkman installation:
class Person(val firstName: String, val lastName: String){
println("beginning of the constructor")
var age = 25
def printInfo = println("Firstname: " + firstName + ", lastname: " + lastName + ", age: " + age)
printInfo
println("end of the constructor")
}
val person = new Person("Matija","Kovacek")
/*
List(1,2,3,4,5).size // 5
List(1,2,3,4,5).size() // error
someobject.methodName()
//or
someobject methodName()
def sum(a: Int, b: Int) = a + b