Skip to content

Instantly share code, notes, and snippets.

View olebedev's full-sized avatar
🎾

Oleg Lebedev olebedev

🎾
View GitHub Profile
@olebedev
olebedev / README.md
Created November 15, 2022 21:50
js2nix demo: marp-cli

Usage

λ export CHROME_PATH="/Applications/Google Chrome.app"
λ nix-shell --pure --keep CHROME_PATH --run 'marp hello.md'
@olebedev
olebedev / minecraft-bedrock-server.nix
Created November 19, 2023 23:11 — forked from datakurre/minecraft-bedrock-server.nix
Minecraft Bedrock Server NixOS module
{ config, lib, pkgs, ... }:
let
libCrypto = with pkgs; stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "minecraft-bedrock-server-libcrypto";
version = "1.16-201.02";
src = fetchurl {
url = "https://minecraft.azureedge.net/bin-linux/bedrock-server-1.16.201.02.zip";
PID = /tmp/awesome-golang-project.pid
GO_FILES = $(wildcard *.go)
serve:
@make restart
@fswatch -o . | xargs -n1 -I{} make restart || make kill
kill:
@kill `cat $(PID)` || true
@olebedev
olebedev / parse-yarn-lock.nix
Created May 22, 2023 05:57 — forked from bouk/parse-yarn-lock.nix
Parse a v1 yarn.lock into a nix expression. Try it with `nix eval -f parse-yarn-lock.nix`
# Parse a yarn.lock file using pure Nix
# yarn.lock v1 files are basically YAML with support for having multiple keys for a single value in a map and without array support.
# Inspired by https://github.com/yarnpkg/yarn/blob/158d96dce95313d9a00218302631cd263877d164/src/lockfile/parse.js
with builtins;
let
# Add index to a list of elements
enumerate = list: genList (i: ({ inherit i; e = elemAt list i; })) (length list);
mkToken = type: value: { inherit type value; };
parseLockfile = str: let

Keybase proof

I hereby claim:

  • I am olebedev on github.
  • I am ole6edev (https://keybase.io/ole6edev) on keybase.
  • I have a public key ASBG9e39P1XIcu91VeAIBbpqHDf-ZTAlmwPz9XC8YG6GTgo

To claim this, I am signing this object:

@olebedev
olebedev / free-database-hosting.md
Created September 4, 2022 22:53 — forked from bmaupin/free-database-hosting.md
Free database hosting
@olebedev
olebedev / codimd-dependencies.nix
Created May 21, 2021 08:27 — forked from sternenseemann/codimd-dependencies.nix
Example of a minified nix output of yarn2nix for the CodiMD/server project yarn.lock
{ fetchurl, fetchgit }:
self:
super:
let
registries = {
yarn = n:
v:
"https://registry.yarnpkg.com/${n}/-/${n}-${v}.tgz";
npm = n:
v:
@olebedev
olebedev / main.js
Last active May 21, 2020 21:37
An AWS Lambda stub
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const handler = async (event, context) => {
return {
ok: true,
event,
context,
};
@olebedev
olebedev / .gitignore
Last active April 19, 2020 22:38 — forked from jgamblin/slackspotify.sh
A Script To Set Current Spotify Song As Slack Status
.apikey
@olebedev
olebedev / The Technical Interview Cheat Sheet.md
Created June 4, 2018 06:20 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.