Deriving a new Array from an existing Array:
['■','●','▲'].slice(1, 3) ⟼ ['●','▲']
['■','●','■'].filter(x => x==='■') ⟼ ['■','■']
['▲','●'].map(x => x+x) ⟼ ['▲▲','●●']
['▲','●'].flatMap(x => [x,x]) ⟼ ['▲','▲','●','●']
// from/to: { left, top, width, height, shape: 'circle' | 'rect' } | |
function CurvedArrow({ from, to }) { | |
function curvedHorizontal(x1, y1, x2, y2) { | |
function pos(t) { | |
let mx = x1 + (x2 - x1) / 2; | |
let p1 = {x: x1, y: y1}; | |
let p2 = {x: mx, y: y1}; | |
let p3 = {x: mx, y: y2}; | |
let p4 = {x: x2, y: y2}; | |
return { |
<link rel="shortcut icon" width=32px> | |
<canvas style="display: none" id="loader" width="16" height="16"></canvas> | |
<script> | |
class Loader { | |
constructor(link, canvas) { | |
this.link = link; | |
this.canvas = canvas; | |
this.context = canvas.getContext('2d'); | |
this.context.lineWidth = 2; |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"copyOnSelect": false, | |
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", | |
// Add custom keybindings to this array. | |
// To unbind a key combination from your defaults.json, set the command to "unbound". | |
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings | |
"keybindings": | |
[ | |
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
download.sh
file and put it into a directory where you want the files to be saved.cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)./download.sh
and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.import System; | |
import System.Windows.Forms; | |
import Fiddler; | |
// INTRODUCTION | |
// | |
// Well, hello there! | |
// | |
// Don't be scared! :-) | |
// |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
// This function is called immediately. The second function is passed in | |
// as the factory parameter to this function. | |
(function (factory) { | |
// If there is a variable named module and it has an exports property, | |
// then we're working in a Node-like environment. Use require to load | |
// the jQuery object that the module system is using and pass it in. | |
if(typeof module === "object" && typeof module.exports === "object") { | |
factory(require("jquery"), window, document); | |
} | |
// Otherwise, we're working in a browser, so just pass in the global |