Skip to content

Instantly share code, notes, and snippets.

View michaelilyin's full-sized avatar

Michael Ilyin michaelilyin

  • Voronezh
View GitHub Profile
private void processOthers(Set<PosixFilePermission> perms, byte b) {
if ((b & 0b1) != 0)
perms.add(PosixFilePermission.OTHERS_EXECUTE);
if ((b & 0b10) != 0)
perms.add(PosixFilePermission.OTHERS_WRITE);
if ((b & 0b100) != 0)
perms.add(PosixFilePermission.OTHERS_READ);
}
@michaelilyin
michaelilyin / CMakeLists.txt
Created October 30, 2015 07:48
server/CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
set (PROJECT server)
project (${PROJECT})
include_directories(include)
AUX_SOURCE_DIRECTORY(src SRC1)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
add_executable (${PROJECT} ${SRC1} ${CMAKE_C_FLAGS})
@michaelilyin
michaelilyin / CMakeLists.txt
Last active November 21, 2016 20:06
OMP-test
cmake_minimum_required(VERSION 3.6)
project(test-app)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -openmp -fopenmp")
set(SOURCE_FILES main.cpp easylogging++.h)
add_executable(test-app ${SOURCE_FILES})
@michaelilyin
michaelilyin / app.module.ts
Created March 28, 2018 15:41
Angular logging service
import {NgModule} from '@angular/core';
import {AppComponent} from './app.component';
import {DEBUG, INFO, LoggingConfiguration} from './shared/utils/logging.service';
@NgModule({
declarations: [
AppComponent
],
imports: [
@michaelilyin
michaelilyin / .gitlab-ci.yml
Created March 29, 2018 09:46
Angular configs
image: weboaks/node-karma-protractor-chrome:xvfb
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- node_modules/
before_script:
- npm install
@michaelilyin
michaelilyin / simple.spec.ts
Last active June 5, 2018 11:32
Angular testing
describe('Person class', () => {
it('should provide full name', () => {
const person = new Person('John', 'Smith');
expect(person.fullName).toBeTruthy();
expect(person.fullName).toEqual('John Smith')
});
});
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import java.util.concurrent.Executors
import java.util.concurrent.atomic.AtomicInteger
import kotlin.concurrent.thread
import kotlin.system.measureTimeMillis
val n = 100
val delay = 1000L
sudo sh -c 'for bin in /opt/jdk-12.0.1/bin/*; do update-alternatives --install /usr/bin/$(basename $bin) $(basename $bin) $bin 100; done'
sudo sh -c 'for bin in /opt/jdk-12.0.1/bin/*; do update-alternatives --set $(basename $bin) $bin; done'
@michaelilyin
michaelilyin / users.component.html
Created May 18, 2020 16:31
Find an issue and propose decision
<span>Total users: {{ (users$ | async).length }}</span>
<div *ngFor="let user of users$ | async">
{{ user.firstName }} {{ user.lastName }}
</div>
@michaelilyin
michaelilyin / task-create-form.component.ts
Last active May 19, 2020 08:02
Find an issue and propose decision
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { TasksService } from '../tasks.service';
import { Location } from '@angular/common';
interface TaskForm {
name: string;
description: string;
}