Skip to content

Instantly share code, notes, and snippets.

View RazmikDev's full-sized avatar

Razmik Seysyan RazmikDev

View GitHub Profile

Suite T

Test title

Test comment

  • ARRANGE step
    document.location
@RazmikDev
RazmikDev / SerializableDeserializable.kt
Created November 8, 2018 22:40
A concept of object model with key-value serialisation support
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 September 4, 2018 15:06
PowerShell profile for ReSharper/Rider developer
# =====================================================================================================================
# 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 November 29, 2015 16:52
PS profile for ReSharper developers (should replace $profile)
# =====================================================================================================================
# 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
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 August 29, 2015 14:19
Sceleton of scheduler that performs tasks with a parallelism level equals to 1
$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 September 4, 2015 12:30
Class that provides methods to take locks on Int32 values using CAS operation.
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