- sierra instructions https://medium.com/@twister.mr/installing-macos-to-virtualbox-1fcc5cf22801
- high sierra instructions https://host-consult.ru/macos-high-sierra-virtualbox/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alex: It's a greedy algorithm, so it doesn't optimize in a perfect manner, but it's good enough | |
Ride = Struct.new(:weight, :count) | |
def calculate_rides(box_weights, max_weight, max_boxes) | |
raise ArgumentError.new("The box weight exceeds the maximum one") if box_weights.any? { |box| box > max_weight } | |
boxes = box_weights.sort.reverse | |
rides = [] | |
boxes.each do |box| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
pinMode(8, OUTPUT); | |
pinMode(13, OUTPUT); | |
} | |
void loop() { | |
// Макс вредло | |
digitalWrite(8, HIGH); | |
digitalWrite(13, HIGH); | |
delay(60000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const currentLanguage = 'ru' // store this in global state (redux, window, localStorage, flux et.c.) | |
const countries = [ | |
{ | |
ru: 'Россия', | |
en: 'Russia', | |
}, { | |
ru: 'США', | |
en: 'USA' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<WebhookEvent:0x00007fa76dd600f8 | |
id: 182109, | |
payload: | |
"{\"event\":\"survey_completed\",\"event_uuid\":\"b91b40ff-0589-48e6-a72c-f6e27abef652\",\"created_at\":\"2019-07-26T22:20:18Z\",\"payload\":{\"survey\":{\"uuid\":\"aab458b0-9929-4271-9600-0c311685c122\",\"sent_at\":\"2019-07-26T15:48:10Z\",\"opened_at\":null,\"responded_at\":\"2019-07-26T22:20:18Z\",\"customer_feedback\":{\"person_type\":\"Customer\",\"score\":9,\"comments\":\"Work was done well. They showed up on time.\"}},\"location\":{\"uuid\":\"b18a4e5d-71b1-40ab-b7be-8d239d7e3e93\",\"importer_uid\":null,\"name\":\"Handyman Connection of Calgary\"},\"sale\":{\"uuid\":\"ff05b55c-7344-4364-87e4-4e6b069096fd\",\"importer_uid\":\"362e1b5d-38af-e911-811a-000c29b7354e 6701-016157\"},\"customer\":{\"uuid\":\"b7be40ab-8cae-4cd2-b7f7-b90835ab4a4c\",\"importer_uid\":\"c54926f9-2aae-e911-8117-000c295a727c\",\"name\":\"Carol Delong\",\"email\":\"[email protected]\",\"notes\":{\"customerType\":\"Residential\",\"customerStatus\":\"Customer\"}}}}", | |
uuid: "b91 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2021-03-20T05:54:41.642Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import objectFetch from 'object-fetch' | |
INNER_CIRCLE_TARGETS_COUNT = 10 | |
class MyComponent extends React.Component { | |
render() { | |
// A big function with a complex logic | |
const { collectorGroup } = this.props | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tslint:disable:no-expression-statement | |
import { test } from 'ava'; | |
import objectFetch from './index'; | |
const object = { a: 'b' }; | |
test('returns key if it exists', t => { | |
t.is(objectFetch(object, 'a'), 'b'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The only significant difference between TS and JavaScript is interface. | |
// Interface declarates that object passed as `obj` should be an object actually | |
interface PassedObject { | |
readonly [key: string]: any; | |
} | |
// Same logic as in our ES6 code | |
const objectFetch = (obj: PassedObject, property: string): any => { | |
// tslint:disable-next-line:no-if-statement | |
if (obj.hasOwnProperty(property)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const objectFetch = (object, propertyName) => { | |
if (object.hasOwnProperty(propertyName)) { | |
return object[propertyName] | |
} | |
throw new ReferenceError(`key not found: ${propertyName}`) | |
} | |
const collectorGroup = { target_count: 10 } |
NewerOlder