Skip to content

Instantly share code, notes, and snippets.

@s0kil
s0kil / keybase.md
Last active December 31, 2019 22:46

Keybase proof

I hereby claim:

  • I am danielsokil on github.
  • I am danielsokil (https://keybase.io/danielsokil) on keybase.
  • I have a public key ASCaaK1iwB82zGy0fYaGyc6mSjthTg-vD2fcAKvs7RIXlQo

To claim this, I am signing this object:

@s0kil
s0kil / git.md
Created December 31, 2019 22:50

Git Commands

Branch & Merge

  • list branches, git branch.
  • * will appear next to the active branch

Remove Untracked Files

  • Dry run, git clean -n
  • Remove files, git clean -f
  • Remove directories, git clean -fd
@s0kil
s0kil / machine-learning.md
Last active December 31, 2019 23:17
Machine and Deep Learning

Machine and Deep Learning

Machine Learning Algorithms

Gradient Descent

  • Optimization algorithm used to find the values of parameters (coefficients) of a function (f) that minimizes a cost of function (cost).
  • Used best when the parameters cannot be calculated analytically (linear algebra) and must be searched for by an optimization algorithm.
@s0kil
s0kil / regex.md
Last active January 5, 2020 04:18

^ Start of line

$ End of line

. Any single character except a line break.

[]

@s0kil
s0kil / html-query-spec.md
Last active January 31, 2020 21:53
HTML Querying Using CSS Selectors & UNIX Paths

HTML Querying Using CSS Selectors & UNIX Paths

Root DOM Element (<html></html>)

  • /

All Divs At Root Element

  • /div

First Div At Root Element

  • /div[0]
@s0kil
s0kil / C4-model.md
Last active February 9, 2020 03:11
C4 model

C4 model

1. System Context

  • Software systems
  • People SystemContext

2. Container

  • Software systems
  • People
@s0kil
s0kil / strong.md
Created February 12, 2020 00:46
Joe Armstrong

"Make it work, then make it beautiful, then if you really have to, make it fast. 90% of the time, if you make it beautiful, it will already be fast. So really, just make it beautiful." - Joe Armstrong

@s0kil
s0kil / EEx.xml
Last active February 25, 2020 20:15
WebStorm EEx snippets (Live Templates)
<templateSet group="EEx snippets">
<template name="e=" value="&lt;%= $END$ %&gt;" description="EEx - Render Expression, replace with result" toReformat="true" toShortenFQNames="true">
<context>
<option name="ELIXIR_CODE" value="true" />
</context>
</template>
<template name="ee" value="&lt;% $END$ %&gt;" description="EEx - Expression, inline with output" toReformat="true" toShortenFQNames="true">
<context>
<option name="ELIXIR_CODE" value="true" />
</context>
function gradingStudents(grades) {
function checkRoundedGrade(grade) {
if (grade < 38) return grade;
let gradeRounded = Math.ceil(grade / 5) * 5;
if ((gradeRounded - grade) < 3) return gradeRounded;
else return grade;
}
return grades.map(grade => checkRoundedGrade(grade));
}