Skip to content

Instantly share code, notes, and snippets.

View cytrowski's full-sized avatar
💭
I may be slow to respond. I have a bunch of junior front-end developers to make

Bartosz Cytrowski cytrowski

💭
I may be slow to respond. I have a bunch of junior front-end developers to make
View GitHub Profile

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

Polecenia konsoli Linux

Operacje na plikach i katalogach

  • pwd - aktualny katalog
  • ls -la - listuje wszystkie dostępne pliki
  • ls -lat - listuje wszystkie dostępne pliki posortowane według czasu modyfikacji
  • cp -r {nazwa pliku/katalogu} {miejsce docelowe} - kopiuje plik lub cały katalog z zawartością we wskazane miejsce
  • mv {nazwa pliku/katalogu} {miejsce docelowe} - przenosi plik lub cały katalog z zawartością we wskazane miejsce (jeśli lokalizacja pliku docelowego jest taka sama jak pliku do przeniesienia, zmienia nazwę)
  • du -sh - pokazuje zajętość całego katalogu
  • du -sh * - pokazuje rozmiar poszczególnych plików i katalogów
@cytrowski
cytrowski / polecenia_git.md
Created November 22, 2017 18:36 — forked from chajr/polecenia_git.md
Polecenia GIT

Przydatne polecenia GIT

  • git init - inicjalizuje repozytorium GIT w katalogu
  • git clone {adres repozytorium} - klonuje repozytorium do katalogu
  • git status - pokazuje status repozytorium (pokazuje informację o zmodyfikowanych, nowych, usuniętych oraz nie należące do repozytorium plikach)
  • git remote add {jakaś nazwa} {adres repozytorium} - dodaje repozytorium innego użytkownika (git remote add upstream https://github.com/bluetree-service/idylla.git)
  • git remote -v lista wszystkich zewnetrznych repozytoriów
  • git remote rm {nazwa dla remota} - usuwa zewnętrzne repozytorium
  • git fetch {nazwa remota} - pobiera listę zmian z innego repozytorium (w tym pokazuje nowe gałęzie)
  • git branch - lista gałęzi w repozytorium
@cytrowski
cytrowski / latency.markdown
Created September 19, 2017 01:14 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@cytrowski
cytrowski / gist:1060d15c9b42c2a6743c28458cd9b80c
Created December 4, 2016 19:20 — forked from Joncom/gist:e8e8d18ebe7fe55c3894
Check if two line segments intersect
// Adapted from: http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/1968345#1968345
function line_intersects(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) {
var s1_x, s1_y, s2_x, s2_y;
s1_x = p1_x - p0_x;
s1_y = p1_y - p0_y;
s2_x = p3_x - p2_x;
s2_y = p3_y - p2_y;
var s, t;
var tablica_1 = [1,2,3,4,6],
tablica_2 = [3,1,5,6],
tablica_3 = [3,1,2,3,6],
tablica_4 = [3,5,6];
function contains(array, item) {
return array.indexOf(item) !== -1;
}
function head(array) {
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
@cytrowski
cytrowski / gist:45c63e1b430f247a61d07c7354843aab
Created June 10, 2016 23:17 — forked from jhgorrell/gist:2244095
emacs to OSX copy and paste awesomeness
;; copy-and-paste to/from emacs and osx application
(defun copy-from-osx ()
(shell-command-to-string "pbpaste"))
(defun paste-to-osx (text &optional push)
(let ((process-connection-type nil))
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
(process-send-string proc text)
(process-send-eof proc))))
@cytrowski
cytrowski / simple-react-playground.html
Created April 27, 2016 23:37 — forked from voronianski/simple-react-playground.html
Quick React prototyping in browser on the fly with ES2015. Use this as boilerplate for your playground and upload html file on some server. Created as a solution for this challenge - http://blog.vjeux.com/2015/javascript/challenge-best-javascript-setup-for-quick-prototyping.html with the help of https://github.com/voronianski/babel-transform-in-…
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>React Quick Prototyping</title>
</head>
<body>
<div id="root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.min.js"></script>
/**
* Created by Tomasz on 30.01.2016.
*/
$(document).ready(function(){
var canvas = $('#canvas')[0];
var cont = canvas.getContext("2d");
var wid = $('#canvas').width(); // szerokosc canvasa
var hei = $('#canvas').height(); // wysokos canvasa