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
/** @jsx React.DOM */
var BootstrapModalMixin = function() {
var handlerProps =
['handleShow', 'handleShown', 'handleHide', 'handleHidden']
var bsModalEvents = {
handleShow: 'show.bs.modal'
, handleShown: 'shown.bs.modal'
, handleHide: 'hide.bs.modal'
/**
* 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
@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>
@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))))
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
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) {
@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;
@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

Effective Engineer - Notes

What's an Effective Engineer?

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

Adopt the Right Mindsets

@cytrowski
cytrowski / gist:87806b40b5b761f5a67ed6d3ad32b5b9
Created February 19, 2018 12:10 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: