Skip to content

Instantly share code, notes, and snippets.

Avatar

Razmik Seysyan RazmikDev

View GitHub Profile
View test.md

Suite T

Test title

Test comment

  • ARRANGE step
    document.location
@RazmikDev
RazmikDev / SerializableDeserializable.kt
Created Nov 8, 2018
A concept of object model with key-value serialisation support
View SerializableDeserializable.kt
import kotlin.reflect.KProperty
import kotlin.reflect.full.isSubtypeOf
import kotlin.reflect.full.starProjectedType
class ValueNotFoundException : Exception()
class TypeMismatchException : Exception()
typealias JavaSerializable = java.io.Serializable
class SerializableValuesMap : LinkedHashMap<String, JavaSerializable>() {
@RazmikDev
RazmikDev / Microsoft.PowerShell_profile.ps1
Created Sep 4, 2018
PowerShell profile for ReSharper/Rider developer
View Microsoft.PowerShell_profile.ps1
# =====================================================================================================================
# Power Plan Management
# ---------------------------------------------------------------------------------------------------------------------
$powerPlans = powercfg -l
$highPerformancePowerPlan = $powerPlans | ForEach-Object { if ($_.contains("High performance")) {
$_.split()[3]
}
}
$balancedPowerPlan = $powerPlans | ForEach-Object { if ($_.contains("Balanced")) {
$_.split()[3]
@RazmikDev
RazmikDev / JetProfile.ps1
Last active Nov 29, 2015
PS profile for ReSharper developers (should replace $profile)
View JetProfile.ps1
# =====================================================================================================================
# Power Plan Management
# ---------------------------------------------------------------------------------------------------------------------
$powerPlans = powercfg -l
$highPerformancePowerPlan = $powerPlans | %{ if ($_.contains("High performance")) { $_.split()[3] }}
$balancedPowerPlan = $powerPlans | %{ if ($_.contains("Balanced")) { $_.split()[3] }}
$powerSaverPowerPlan = $powerPlans | %{ if ($_.contains("Power saver")) {$_.split()[3] }}
$currentPowerPlan = $(powercfg -getactivescheme).split()[3]
function Get-Plan
View Logging.ps1
Function Log-Start{
<#
.SYNOPSIS
Creates log file
.DESCRIPTION
Creates log file with path and name that is passed. Checks if log file exists, and if it does deletes it and creates a new one.
Once created, writes initial logging data
.PARAMETER LogPath
@RazmikDev
RazmikDev / Scheduler.ps1
Last active Aug 29, 2015
Sceleton of scheduler that performs tasks with a parallelism level equals to 1
View Scheduler.ps1
$jobName = "SchedulerJOB"
$schedulePath = Join-Path $PSScriptRoot "Schedule.json"
$epoch = Get-Date -Year 1970 -Day 1 -Month 1
function Read-WorkItems()
{
$json = Get-Content -Path $schedulePath -Raw
$workItems = (ConvertFrom-Json $json)
$workItems
@RazmikDev
RazmikDev / Int32Lock.cs
Last active Sep 4, 2015
Class that provides methods to take locks on Int32 values using CAS operation.
View Int32Lock.cs
using System;
using System.Runtime.CompilerServices;
using System.Threading;
namespace Rs.Threading
{
/// <summary>
/// Provides methods to take locks on <see cref="Int32"/> values using CAS operation.
/// </summary>
public static class Int32Lock