Skip to content

Instantly share code, notes, and snippets.

View ArisAgnew's full-sized avatar
:electron:
You gotta do what you gotta do

Εὐγενής Αναγνωστόπουλος ArisAgnew

:electron:
You gotta do what you gotta do
  • Europe
View GitHub Profile
@ArisAgnew
ArisAgnew / MemoryCache.cs
Created September 9, 2020 08:36
MemoryCache
//Get instance of cache
using System.Runtime.Caching;
var cache = MemoryCache.Default;
//Check if cache contains an item with
cache.Contains("CacheKey");
//get item from cache
var item = cache.Get("CacheKey");
@ArisAgnew
ArisAgnew / Big_O_Performance.md
Last active April 16, 2021 09:40
Big O performance

Big O performance of common functions of different Java Collections.

List Add Remove Get/Read Contains Next Data Structure
[] O(n) O(n) O(1) O(n) O(1) Array
List O(1)* O(n) O(n) O(n) O(1) Array
ArrayList O(1) O(n) O(1) O(n) O(1) Array
LinkedList O(1) O(1) O(n) O(n) O(1) Linked List
CopyOnWriteArrayList O(n) O(n) O(1) O(n) O(1) Array
@ArisAgnew
ArisAgnew / invokeMetho_testContext.java
Last active June 1, 2020 17:02
preparePage(final Method invokedMethod, final ITestContext testContext)
@BeforeMethod
public void preparePage(final Method invokedMethod, final ITestContext testContext) {
inBrowser().navigate(refresh());
testContext.getSuite().getAllMethods()
.stream()
.filter(m -> m.getMethodName().equals(invokedMethod.getName()))
.flatMap(tngm -> Stream.of(tngm.getGroups()))
.filter(s -> s.equals("Управление доступами"))
.findFirst()