Skip to content

Instantly share code, notes, and snippets.

View korotkevics's full-sized avatar
🇨🇭
Morges, Switzerland

Sándor Korotkevics korotkevics

🇨🇭
Morges, Switzerland
View GitHub Profile
@korotkevics
korotkevics / Samples.c
Created November 27, 2016 18:07
Uni samples.
//
// Created by Sandor Korotkevics on 27.11.16.
//
#include <stdio.h>
int greatestCommonDivisor(int first, int second);
int fibonacci(int limit);
typedef struct { //Experiments with typedef struct.
@korotkevics
korotkevics / gist:16405e47d746f35085e3ff81f0616ea0
Created March 22, 2018 23:23 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
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
# -*- mode:python; -*-
#
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@korotkevics
korotkevics / equals-hash-tostring.java
Created April 26, 2018 12:19 — forked from rocketraman/equals-hash-tostring.java
Example of JDK7+ Objects equals, hash and Guava 18+ toString implementations
import com.google.common.base.MoreObjects;
import java.util.Objects;
public class Address {
...
@Override
public boolean equals(Object obj) {
@korotkevics
korotkevics / .gitconfig
Created June 11, 2018 16:27 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
dmerged = "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
st = status
@korotkevics
korotkevics / cloudbuild.yaml
Last active March 15, 2020 20:58
cloudbuild.yaml - zakładamy, że $_BRANCH_NAME_LC jest zdefiniowane jako: $(echo $BRANCH_NAME | tr A-Z a-z), a $BRANCH_NAME z kolei jest istniejącą zmienną środowiskową zawierającą nazwę gałęzi. Robię taką konwersję, bo chcę utworzyć namespace o nazwie równej nazwie gałęzi z tym że musi być lowercase.
steps:
#step 1
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: [
'-c',
'docker pull gcr.io/$PROJECT_ID/clorinda-server:latest || exit 0'
]
#step 2
- name: gcr.io/cloud-builders/docker