Skip to content

Instantly share code, notes, and snippets.

View vhodiak's full-sized avatar
🏠
Working from home

Volodymyr Hodiak vhodiak

🏠
Working from home
  • OTAKOYI LLC
  • Lviv, Ukraine
View GitHub Profile
import boto3
import csv
# Constants
S3_BUCKET_SOURCE = 'source-bucket'
S3_BUCKET_DEST = 'dest-bucket'
S3_PREFIX = 'media/'
EXPORTED_FILE_PATH = 'ids.csv'
s3c = boto3.client('s3')

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@vhodiak
vhodiak / task-2.dart
Created January 17, 2023 08:55
dart task 2
void main() {
final a = ['a', 'b', 'c'];
final b = ['b', 'c', 'd'];
/// Create c as unique result of a & b;
/// print result
/// print(c);
}
@vhodiak
vhodiak / task1.dart
Last active January 17, 2023 08:54
dart-task-1
void main() {
final a = [0,1,2,3,4,5,6,7,8,9];
/// create b with is sum of even elements;
/// final b = ...
/// print(b);//20
}
@vhodiak
vhodiak / codereview-flutter.md
Created October 31, 2022 15:28
Codereview checklist for flutter developers

The following aspects are considered to ensure good quality and high-performance deliverables

  1. Requirements
  • 1.1 Task requirements have been met
  1. Compiler
  • 2.1 Code compiles without any warnings
  • 2.2 Static analysis passes
  • 2.3 Favorite IDE shows 0 errors, warnings
  • 2.4 No spelling mistakes, except for specific project names or 3rd party packages
  1. Naming conventions
  • 3.1 Classes, enums, typedefs, and extensions name are in UpperCamelCase
import 'package:imagineautos/models/body_style.dart';
import 'package:imagineautos/models/location/location.dart';
import 'package:imagineautos/models/order_by.dart';
import 'package:imagineautos/models/vehicle_make.dart';
import 'package:imagineautos/models/vehicle_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'vehicle_search_parameters.g.dart';
@JsonSerializable(nullable: true)
@vhodiak
vhodiak / saved-search-model
Created August 17, 2021 17:48
saved-search-model
import 'package:imagineautos/models/body_style.dart';
import 'package:imagineautos/models/location/location.dart';
import 'package:imagineautos/models/order_by.dart';
import 'package:imagineautos/models/vehicle_make.dart';
import 'package:imagineautos/models/vehicle_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'vehicle_search_parameters.g.dart';
@JsonSerializable(nullable: true)
@vhodiak
vhodiak / dart
Created July 14, 2021 16:05
remove vehicles if thumbnail is broken
void _removeVehicle(Vehicle v) {
vehicles.remove(v);
emit(VehicleSearchRequestSucceed(vehicles: vehicles, params: _params));
}
void _updateVehicleThumbnailWithFirstElementFromGallery(Vehicle v) {
if(v.photoUrls == null ) return;
if(v.photoUrls.isEmpty) return;
@vhodiak
vhodiak / dart
Created July 1, 2021 16:17
cover-image
/// If thumbnail url is not provided - get thumbnail from video
class ThumbnailVideo extends StatelessWidget {
final String thumbnailUrl;
final String videoUrl;
final String customNoImage;
const ThumbnailVideo({
Key key,
this.thumbnailUrl,
@required this.videoUrl,