Skip to content

Instantly share code, notes, and snippets.

Leonid Shifrin lshifr

Block or report user

Report or block lshifr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aderaaij / es6-spread-operator.js
Last active Jul 25, 2018
The spread operator can expand(spread) any iterable like an array or a string.
View es6-spread-operator.js
const avengers = ['Thor', 'The Hulk', 'Captain America'];
let guardians = ['Star Lord', 'Gamorra', 'Drax', 'Rocket', 'Groot'];
// Spread out arrays in a new array and put a new value in between them
const heroes = [...avengers, 'Loki', ...guardians];
// Adding new stuff to an array just got easier too
guardians = [...guardians, 'Mantis', 'Yondu', 'Nebula'];
// Or simply making a TRUE copy of an array
const avengersCopy = [...avengers];
rmoff /
Last active Jan 22, 2020
cx_Oracle install on MacOS
  1. Download Instant Client:
  1. Unzip and move to /opt

  2. Create symlink


The future is here: Classless object-oriented programming in JavaScript.

Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.

Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.

I think it's really, really sleek, and this is what it looks like:

function dog(spec) {
staltz /
Last active Jan 28, 2020
The introduction to Reactive Programming you've been missing
gousiosg / stackoverflow.sql
Last active Jan 12, 2020
Script to import the stackexchange dumps into MySQL
View stackoverflow.sql
# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table badges (
UserId INT,
jboner / latency.txt
Last active Jan 28, 2020
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
btoone /
Last active Jan 27, 2020
A curl tutorial using GitHub's API


An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

You can’t perform that action at this time.