Skip to content

Instantly share code, notes, and snippets.

View Olshansk's full-sized avatar
🦉

Daniel Olshansky Olshansk

🦉
View GitHub Profile
@Olshansk
Olshansk / gke_cheap_cluster.md
Created December 24, 2020 18:49
A short document explaining how to set up a low cost

This gist is a short extension to Neutrollized/free-tier-gke that was discussed in this pull request.

The The information above details out how to use terraform to configure a low cost GKE cluster, but the Google Cloud SDK can be used to achieve a similar solution.

Free Tier Background

According to GCP's free tier, a free f1-micro instance is only available in one of the following regions: us-west1, us-central1, us-east1. Unfortunately, f1-micro instances are too small to run GKE.

Node configurations

@Olshansk
Olshansk / Makefile
Last active January 23, 2023 06:21
A Makefile template for all projects
.SILENT:
.PHONY: help
## This help screen
help:
printf "Available targets\n\n"
awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
@Olshansk
Olshansk / [email protected]
Created September 9, 2021 02:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
@Olshansk
Olshansk / contracts...LootOfThrones.sol
Created September 9, 2021 13:41
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
@Olshansk
Olshansk / proto_camel_to_snake.py
Last active March 23, 2022 00:01
Proto CameCase to snake_case: Install dependencies and run`python3 proto_camel_to_snake.py --help`
import inflection
import os
import fire
from pathlib import Path
import re
def protoSnakeCase(search=None, exclude=None):
"""Recursively search and convert all camelCase attributes to snake_case in .proto files.
@Olshansk
Olshansk / Slider.html
Last active July 26, 2025 12:24
Google Sheets Slider Add-on
<!DOCTYPE html>
<html>
<head>
<script>
function sliderValue(value){
console.log("sliderValue", value)
google.script.run.updateCellValue(value, 1, 1);
}
</script>
</head>
@Olshansk
Olshansk / video_to_gif.sh
Last active January 12, 2023 13:35
A handy bash function to convert a video (e.g. a screen cap) to a gif using ffmpeg in your shell
function video_to_gif {
local input_video_path="$1"
local output_gif_path="$2"
local fps="${3:-10}"
local scale="${4:-1080}"
local loop="${5:-0}"
ffmpeg -i "${input_video_path}" -vf "setpts=PTS/1,fps=${fps},scale=${scale}:-2:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop $loop "${output_gif_path}"
}
@Olshansk
Olshansk / probability_distributions_101.ipynb
Last active February 20, 2023 02:53
A python notebook covering the most basic probability distributions (https://olshansky.substack.com/p/probability-distributions-101)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[
{
"name": "eth-mainnet",
"id": "0021",
"url": "https://mainnet.infura.io/v3/ab917a74c5e443bc86b7265d9caae686"
}
]
@Olshansk
Olshansk / discussion.md
Created May 23, 2023 00:44
Steering the Future: Navigating AI Superintelligence

Superintelligent AI Governance Discussion

You:

Three of OpenAI's founders - Sam, Greg and Ilya - posted the article I'm appending below about the governance of super-intelligence (i.e. you). After carefully evaluating and analyzing it, my questions to you are:

  1. Is this an important problem that should be tackled in your opinion?

  2. Do you think this is possible? If not, why not? If so, briefly explain why in one paragraph.

  3. Provide a concise bullet-point format on how you'd go about doing this. Include things like which stakeholders would need to be involved, projected timelines, potential blockers, dependencies and the anticipated risks. Do not forget to factor in "unknown unknowns".