Skip to content

Instantly share code, notes, and snippets.

View DmitryOlkhovoi's full-sized avatar
🖖

Dmitry Olkhovoi DmitryOlkhovoi

🖖
View GitHub Profile
Screw 6-32 x .25 Inches Used in PC case cover and I/O plates
Screw 6-32 x .15 Inches Used to install hard drives
Screw M3 x .25 Inches Used to install floppy drive, CD-ROM drive and motherboard
Screw 4-40 x .18 Inches Used in I/O plate connector
Metal Jackscrew Standoffs 6-32 to M3 Used in motherboard installation and pre-taped PC chassis
Metal Jackscrew Standoffs 4-40 Used in I/O plate connector
Case fan screw Used to install plastic-framed cooling fans to PC chassis
Nuts 4-40 x 6 mm Used in joining cables
Nuts 4-40 x 1.6 mm Used in screw 4-40
AT-style PC Case Standoffs Used to install motherboards to a PC chassis
@DmitryOlkhovoi
DmitryOlkhovoi / eloquentjavascript-The sum of a range.js
Created December 10, 2017 11:25
eloquent javascript The sum of a range
function sum(numbers) {
return numbers.reduce((acc, current) => acc + current, 0)
}
function range(start, end, step = 1) {
const rangeArray = []
const direction = end > start
for(let i = start; (direction ? (i <= end) : (i >= end)); i += step) {
rangeArray.push(i)
@DmitryOlkhovoi
DmitryOlkhovoi / eloquent javascript.js
Created December 10, 2017 12:17
eloquent javascript Reversing an array
function reverse(array) {
const reversedArray = []
for(let i = array.length - 1; i >= 0; i -= 1) {
reversedArray.push(array[i])
}
return reversedArray
}
class Node {
constructor(word, index = 0) {
this.count = 0
this.children = new Map()
if (word) { // Could be undefined
this.symbol = word[index]
this.completeWord = ((word.length - 1) === index)
if (!this.completeWord) {
const products = [
{id: 1, price: 10}, {id: 2, price: 11}, {id: 3, price: 1},
{id: 4, price: 3}, {id: 5, price: 1}, {id: 6, price: 8},
{id: 7, price: 3}, {id: 8, price: 0}, {id: 9, price: 4},
{id: 10, price: 5}, {id: 11, price: 9}, {id: 12, price: 13},
];
const getFirstItems = (products, size) => {
return products.slice(0, size)
}
const products = [
{id: 1, price: 10}, {id: 2, price: 11}, {id: 3, price: 1},
{id: 4, price: 3}, {id: 5, price: 1}, {id: 6, price: 8},
{id: 7, price: 3}, {id: 8, price: 0}, {id: 9, price: 4},
{id: 10, price: 5}, {id: 11, price: 9}, {id: 12, price: 13},
];
const getFirstItems = (products, size) => {
return products.slice(0, size)
}
const products = [
{id: 1, price: 10}, {id: 2, price: 11}, {id: 3, price: 1},
{id: 4, price: 3}, {id: 5, price: 1}, {id: 6, price: 8},
{id: 7, price: 3}, {id: 8, price: 0}, {id: 9, price: 4},
{id: 10, price: 5}, {id: 11, price: 9}, {id: 12, price: 13},
];
// Don't like it, but don't like dublications as well :)
// We are not making a real world here, so, let's just do it a little bit clearer
const nullReturn = {
//
// main.swift
// Cars creator
//
// Created by Dmitry Olkhovoi on 5/3/18.
// Copyright © 2018 Dmitry Olkhovoi. All rights reserved.
//
var cars = [String]()
var exit = false
.btn {
@apply text-black text-base leading-snug;
@apply py-3 px-4 border-none rounded-lg;
@apply inline-block cursor-pointer no-underline;
&:focus {
@apply outline-none;
}
}
&:hover {
background-color: var(--grey04);
}
&.accent {
color: var(--blue01);
}
&.primary {
@apply text-white;