Skip to content

Instantly share code, notes, and snippets.

View Olshansk's full-sized avatar
🦉

Daniel Olshansky Olshansk

🦉
View GitHub Profile
@Olshansk
Olshansk / suppressed_keywords.ipynb
Created July 9, 2023 04:02
Suppressed keywords
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Olshansk
Olshansk / function-calling.ipynb
Created July 9, 2023 04:01 — forked from kylemcdonald/function-calling.ipynb
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Olshansk
Olshansk / rt.py
Created June 19, 2023 00:18
Get my ratings off rotten tomatoes (dot) py
import json
import os
import requests
# Quick Instructions:
# 1. I used chrom's "copy as curl" to get a request from rotten tomatoes.com
# 2. Use https://curlconverter.com/ to get the python code for it
# 3. Put the ID and COOKIe in env vars
# 4. Run with `rt.py` >> `tv.json` or `movie.json` depending on the TYPE
@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".

[
{
"name": "eth-mainnet",
"id": "0021",
"url": "https://mainnet.infura.io/v3/ab917a74c5e443bc86b7265d9caae686"
}
]
@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.
@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 / 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 / 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 / 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