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
Last active December 15, 2024 16:25
LLM CLI in Nix

Installation

nix-env -i -f ./default.nix
import time
import keyring
import keyring.errors
from getpass import getpass
import json
import boto3
class LazyS3Client:
def __init__(self):
@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";
@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 / 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 / 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