Skip to content

Instantly share code, notes, and snippets.

@ukoloff
ukoloff / scoop.ps1
Last active September 20, 2023 14:17
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iwr -useb get.scoop.sh
scoop install git
scoop bucket add extras
scoop bucket add versions
@ukoloff
ukoloff / cpt.cmd
Last active October 18, 2022 04:07
Stop auth for Cisco Packet Tracer
netsh advfirewall firewall add rule name="Cisco Packet Tracer" dir=out program="C:\Program Files\Cisco Packet Tracer 8.0\bin\PacketTracer.exe" action=block
@ukoloff
ukoloff / kth.cpp
Last active April 12, 2019 06:16
Various algorithms
// Order Statistic
// https://stepik.org/lesson/12564/step/8?unit=2992
#include <utility>
#include <vector>
template <typename T>
T kth(std::vector<T>& v, size_t k) {
size_t L = 0, R = v.size();
while (L + k < R) {
@ukoloff
ukoloff / async-generator.js
Last active April 7, 2019 17:09
Hand made JS generators
function range(from, to) {
return { next: nextPromise, [Symbol.asyncIterator]: iterator }
function next() {
return from <= to
? { done: false, value: from++ }
: { done: true }
}
function iterator() {
@ukoloff
ukoloff / Z.js
Last active April 12, 2019 06:16
Z-combinator
//
// Z-combinator
// https://habr.com/ru/post/322052/
//
const Z = f => (f => f(f))(z => f(x => z(z)(x)))
@ukoloff
ukoloff / fib.cpp
Last active December 18, 2018 14:07
C++ snippets for Algorithms/C++ course
// Числа Фибоначчи
#include <ctime>
#include <iostream>
#include <vector>
int fib(int n);
int fibM(int n);
int fibM(int n, std::vector<int>&);
int fibSM(int n);
int fibF(int n);
@ukoloff
ukoloff / main.cpp
Created September 19, 2018 09:15
algo-1 created by ukoloff - https://repl.it/@ukoloff/algo-1
#include <iostream>
#include <cmath>
int main() {
std::cout << "Введите два числа:";
int a, b;
std::cin >> a >> b;
std::cout << a << " + " << b << " = " << a + b << std::endl;
std::cout << a << " - " << b << " = " << a - b << std::endl;
@ukoloff
ukoloff / ubuntu-kbd.sh
Created June 18, 2018 14:46
Fiddle Ubuntu / Gnome keyboard
dconf write /org/gnome/desktop/input-sources/xkb-options "['grp_led:scroll', 'numpad:microsoft']"
@ukoloff
ukoloff / .vscode-launch.json
Last active June 16, 2018 16:16
Minimal VSCode extension
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",