Skip to content

Instantly share code, notes, and snippets.

View yay's full-sized avatar

Vitaly Kravchenko yay

  • J.P. Morgan
  • London, UK
View GitHub Profile
@yay
yay / mman.h
Created June 9, 2022 11:46
mman.h
/*
* Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@yay
yay / crosshair.kt
Created August 8, 2018 13:48
Renders a dashed crosshair on JavaFX canvas when mouse is dragged over it
fun GraphicsContext.group(op: GraphicsContext.() -> Unit) {
save()
op(this)
restore()
}
// ...
val ctx = canvas.graphicsContext2D
canvas.onMouseDragged = EventHandler { e ->
package com.vitalyk.kotlin.sandbox
import javafx.application.Application
import javafx.geometry.Insets
import javafx.geometry.Pos
import javafx.scene.Scene
import javafx.scene.canvas.Canvas
import javafx.scene.control.Button
import javafx.scene.control.Label
import javafx.scene.control.Slider
@yay
yay / circles.js
Last active March 2, 2018 16:16
Animating 5000 circles with D3.
const width = 800;
const height = 400;
let data = [];
for (let i = 0; i < 5000; i++) {
data.push({
x: width * Math.random(),
y: height * Math.random(),
dx: Math.random() - 0.5,
dy: Math.random() - 0.5
@yay
yay / time.js
Created October 4, 2016 14:29
D3 4.x: axis & time scale issue
var now = new Date();
var then = new Date();
then.setDate(now.getDate() + 7);
var axis = d3.axisTop().ticks(d3.timeDays).tickFormat(d3.timeFormat('%b %d'));
var scale = d3.scaleTime().domain([now, then]).range([0, 500]);
axis.scale(scale);
d3.select(document.body).append('svg').append('g').call(axis); // TypeError: t.range is not a function