Skip to content

Instantly share code, notes, and snippets.

View akolybelnikov's full-sized avatar
:octocat:
Building the future, one line of code at a time. 🚀

reddree akolybelnikov

:octocat:
Building the future, one line of code at a time. 🚀
  • Trading Point Group
  • Athens, Greece
  • 06:51 (UTC +02:00)
  • LinkedIn in/reddree
View GitHub Profile
@akolybelnikov
akolybelnikov / longest_incrementing_subslice.rs
Last active November 9, 2020 13:13 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn find_subseq(s: &[u8]) -> u8 {
let mut res: u8 = 1;
let mut i = 0;
while (i < s.len() - 1) && s[i] < 255 && (s[i] + 1 == s[i + 1]) {
res += 1;
i += 1;
}
return res;
}
@akolybelnikov
akolybelnikov / terminate-worker-threads.c
Created June 6, 2020 00:23 — forked from mfukar/terminate-worker-threads.c
C11 code to have a POSIX multithreaded application which signal work completion via a condition variable, and then terminate.
#include <unistd.h>
#include <stdbool.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#define NUM_THREADS 10
pthread_mutex_t cv_mutex;
pthread_cond_t notification_cv;
@akolybelnikov
akolybelnikov / TimSort.js
Created May 8, 2020 22:11
Implementation of the Timsort algorithm in JavaScript
/*
* timsort Javascript
*
* Licensed under GPL 3 ( http://www.gnu.org/licenses/gpl.html ) license.
*
*/
Array.prototype.timsort = function(comp){
var global_a=this
var MIN_MERGE = 32;
@akolybelnikov
akolybelnikov / .gitconfig.aliases
Created April 21, 2020 12:49 — forked from crunchie84/.gitconfig.aliases
git alias for the win 💪
#
# Include this in your own .gitconfig by using the
# [include] directive with the path to this file
#
# [include]
# path = ~/.gitconfig.aliases
#
# If you don't have any existing includes, you can add this via the following command
#
# git config --global include.path ~/.gitconfig.aliases
@akolybelnikov
akolybelnikov / setup.sh
Created March 27, 2020 10:11 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install

Keybase proof

I hereby claim:

  • I am akolybelnikov on github.
  • I am akolybelnikov (https://keybase.io/akolybelnikov) on keybase.
  • I have a public key ASDBT2fG6lP9Ydx6d2dEqtxtaAdNhFgk_dfnoQ1MFgAJ1wo

To claim this, I am signing this object:

@akolybelnikov
akolybelnikov / main.rs
Created January 18, 2020 18:17 — forked from AnthonyMikh/main.rs
Решение задачи №138 от UniLecs (Максимальная последовательность по модулю)
extern crate itertools;
use itertools::{Itertools, Either::*};
// Самый первый вариант — разбиваем массив
// на вектор отрицательных чисел и вектор положительных,
// а затем возвращаем тот, для которого абсолютная сумма элементов больше.
fn max_abs_sum_subset_1(arr: &[i32]) -> Vec<i32> {
let (neg, pos): (Vec<_>, Vec<_>) = arr.iter().cloned()
.partition_map(|x| if x < 0 { Left(x) } else { Right(x) });
@akolybelnikov
akolybelnikov / netlify.sh
Created October 12, 2019 16:58 — forked from lightdiscord/netlify.sh
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web
@akolybelnikov
akolybelnikov / playground.rs
Created October 9, 2019 09:22 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use crate::node::Node;
use serde_json::Value;
use serde::ser::{Serialize, SerializeMap, Serializer};
use json_patch::merge;
struct WrapDirectory<'a, T> {
name: &'a str,
value: &'a T
}
@akolybelnikov
akolybelnikov / playground.rs
Created October 6, 2019 20:46 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::cmp::Eq;
#[derive(Debug)]
pub struct RawKV {
key: String,
value: String
}