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. 🚀
View GitHub Profile
@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
@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
}
@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
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 / 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 / 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);