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
  • 05:55 (UTC +02:00)
  • LinkedIn in/reddree
View GitHub Profile
@akolybelnikov
akolybelnikov / date-fns-date-adapter.ts
Created February 25, 2019 17:13 — forked from JoniJnm/date-fns-date-adapter.ts
date-fns angular material adapter
import {Injectable} from '@angular/core';
import {DateAdapter} from '@angular/material';
import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns';
// CONFIG. Use environment or something for a dynamic locale and settings
import {es as locale} from 'date-fns/locale';
const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday...
export const MAT_DATE_FNS_DATE_FORMATS = {
@akolybelnikov
akolybelnikov / index.html
Created May 4, 2019 11:22
Pickle Rick Maze Game
<html lang="en-GB">
<head>
<meta charset="utf-8">
<body>
<div id="gradient"></div>
<div id="page">
<div id="Message-Container">
<div id="message">
<h1>Congratulations!</h1>
<p>You are done.</p>
@akolybelnikov
akolybelnikov / rename.js
Created May 26, 2019 22:01 — forked from scriptex/rename.js
Rename all files in a folder with NodeJS
const { join } = require('path');
const { readdirSync, renameSync } = require('fs');
const [dir, search, replace] = process.argv.slice(2);
const match = RegExp(search, 'g');
const files = readdirSync(dir);
files
.filter(file => file.match(match))
.forEach(file => {
const filePath = join(dir, file);
@akolybelnikov
akolybelnikov / git-overwrite-branch.sh
Created July 10, 2019 13:12 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@akolybelnikov
akolybelnikov / LIS.js
Last active August 20, 2019 20:25
Dynamic programming algorithm for a longest increasing subsequence (Introduction to Graduate Algorithms, OMSSC at Georgia Tech with Udacity, CS 6515)
let array = [5, 7, 4, -3, 9, 1, 10, 4, 5, 8, 9, 3]
function findLongestIncreasingSubsequence(x) {
let maxArray = new Array(x).fill(1)
let max = 1
for (let i = 1; i < x; i++) {
for (let j = 0; j < i; j++) {
if (array[j] < array[i] && maxArray[i] <= maxArray[j]) {
maxArray[i] += 1
if (maxArray[i] > max) {
@akolybelnikov
akolybelnikov / LCS.js
Last active August 20, 2019 20:26
Dynamic programming algorithm for a Longest Common Subsequence (Introduction to Graduate Algorithms, OMSSC at Georgia Tech with Udacity, CS 6515)
let X = ['B', 'C', 'D', 'B', 'C', 'D', 'A']
let Y = ['A', 'B', 'E', 'C', 'B', 'A', 'B']
function L(x,y) {
let matrix = new Array(x.length + 1).fill(new Array(y.length + 1).fill(0))
let max = 0
for (let i = 1; i < matrix.length; i++) {
for (let j = 1; j < matrix[i].length; j++) {
if (x[i-1] === y[j-1]) {
matrix[i][j] = matrix[i-1][j-1] + 1
@akolybelnikov
akolybelnikov / MCS.js
Last active October 18, 2022 19:50
Dynamic programming algorithm for a Maximum Contiguous Subsequence (Introduction to Graduate Algorithms, OMSSC at Georgia Tech with Udacity, CS 6515), Dasgupta-Papadimitriou-Vazirani, 6.1
let S = [5, 15, -30, 10, -5, 40, 10]
function L(arr) {
let table = new Array(arr.length)
table[0] = arr[0]
let max
let sum = arr[0]
for (let i = 1; i < arr.length; i++) {
if (sum + arr[i] > arr[i]) {
table[i] = sum + arr[i]
Description: fix incorrect function parsing
Author: Chet Ramey <[email protected]>
Index: bash-4.2/bash/builtins/common.h
===================================================================
--- bash-4.2.orig/bash/builtins/common.h 2010-05-30 18:31:51.000000000 -0400
+++ bash-4.2/bash/builtins/common.h 2014-09-22 15:30:40.372413446 -0400
@@ -35,6 +35,8 @@
#define SEVAL_NOLONGJMP 0x040
@akolybelnikov
akolybelnikov / find-words.lisp
Created September 2, 2019 16:39 — forked from vseloved/find-words.lisp
splitting text w/o spaces into words
(ql:quickload :cl-ppcre)
(ql:quickload :rutils)
(use-package :rutil)
(named-readtables:in-readtable rutils-readtable)
(defpar *orig*
#/I joined Hacker News around 5 years ago. I used to wake up and do the grim commute each morning to London from my home and the only thing that made it vaguely ok was Hacker News. It was a great place to go and find interesting articles from genuinely passionate people. It also used to be a really safe place to launch a startup that you'd spent days, weeks, years on - your project. It was a place where you could launch your startup and know you'd get great constructive feedback. People may not necessarily like your site but they'd admire you for having the balls to launch it, for spending time developing something that you hoped could benefit people in some way. They'd want you to succeed and they'd try and help you succeed with feedback that would ultimately help you. Unfortunately, today's Hacker News audience is no longer the same. Today's Hacker News is a place where us
@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
}