Skip to content

Instantly share code, notes, and snippets.

View Olshansk's full-sized avatar
🦉

Daniel Olshansky Olshansk

🦉
View GitHub Profile
@Olshansk
Olshansk / github_checkout_remote.sh
Created September 25, 2024 22:10
Git helpers to checkout collaborator branches from the main or forked repos
# Example usage: gcor feature-branch
# This will create a local branch 'feature-branch' based on 'origin/feature-branch'
function gcor {
# Create a new branch locally based on a remote branch from origin
git checkout -b $1 origin/$1
# Set the upstream branch for the new local branch to track the remote branch
git branch --set-upstream-to=origin/$1 $1
}
@Olshansk
Olshansk / llm.sh
Last active September 28, 2024 00:47
A bash wrapper around python's mlx_whisper to leverage the GPU on a mac for transcription
# A one liner to leverage the GPU on a mac to transcribe audio files
# Inspired by https://simonwillison.net/2024/Aug/13/mlx-whisper/
llm_transcribe_recording () {
local file_path="$1"
python3 -c "
import mlx_whisper
result = mlx_whisper.transcribe('$file_path', path_or_hf_repo='mlx-community/distil-whisper-large-v3')
print(result['text'])
"
}
# Run with `streamlit run easy_email.py` after `pip install streamlit`
# Required Libraries
import streamlit as st
# Streamlit App
def main():
st.title("EasyEmail")
# Campaign Name

Why Pocket is Rolling with Rollkit: a Technical Deep Dive

tl;dr The Pocket Network core protocol team has decided to implement the first version of the next iteration of the protocol (v1) as a “micro-rollup” using Rollkit with Celestia as a Data Availability (DA) layer.

You can read the announcement by @MatthewRossi, our Head of Product (Protocol), on behalf of the Pocket Network Foundation, here to skip the technical history and jump straight to the point.

🛑 Taking a Pause to Forge Ahead 🛑

In early August, the Pocket Network core protocol team made a crucial decision: we temporarily halted all development on the upcoming version of the Pocket Network Protocol: the Shannon upgrade (formerly referred to as v1). We embarked on a 3-week intensive research to evaluate rapid advancements of other projects in the industry and ensure an opti

@Olshansk
Olshansk / akash_pokt_v2.sh
Last active July 21, 2023 21:19
Akash Pocket Temp 2
#!/bin/bash
TZ=Europe/London && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt-get install -y wget gcc make git nvme-cli nano unzip runit pv aria2 lz4
runsvdir -P /etc/service &
if [[ -n $SSH_PASS ]]
then
apt-get install -y ssh
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && (echo $SSH_PASS; echo $SSH_PASS) | passwd root && service ssh restart
fi
wget https://go.dev/dl/go1.20.1.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.20.1.linux-amd64.tar.gz
@Olshansk
Olshansk / akash_pokt.sh
Last active July 20, 2023 19:58
Akash Pocket Test
#!/bin/bash
TZ=Europe/London && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt-get install -y wget gcc make git nvme-cli nano unzip runit pv aria2 lz4
runsvdir -P /etc/service &
if [[ -n $SSH_PASS ]]
then
apt-get install -y ssh
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && (echo $SSH_PASS; echo $SSH_PASS) | passwd root && service ssh restart
fi
wget https://go.dev/dl/go1.20.1.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.20.1.linux-amd64.tar.gz
@Olshansk
Olshansk / Makefile
Created July 12, 2023 04:27
PyMakefileStarter: Python Project Makefile Foundation
SHELL := /bin/bash
.SILENT:
.PHONY: help
.DEFAULT_GOAL := help
help: ## Prints all the targets in all the Makefiles
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: list
@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