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
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
rmoff / foo.md
Last active Jul 18, 2019
cx_Oracle install on MacOS
View foo.md
  1. Download Instant Client:
  • instantclient-basic-macos.x64-11.2.0.4.0.zip
  • instantclient-sdk-macos.x64-11.2.0.4.0.zip
  • instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
  1. Unzip and move to /opt

  2. Create symlink

View classless.md

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
staltz / introrx.md
Last active Oct 16, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@gousiosg
gousiosg / stackoverflow.sql
Last active Sep 3, 2019
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 (
Id INT NOT NULL PRIMARY KEY,
UserId INT,
@jboner
jboner / latency.txt
Last active Oct 15, 2019
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
btoone / curl.md
Last active Oct 16, 2019
A curl tutorial using GitHub's API
View curl.md

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
You can’t perform that action at this time.