Skip to content

Instantly share code, notes, and snippets.

View okplanbo's full-sized avatar
🐢
Reminder: I need to walk more

Boris okplanbo

🐢
Reminder: I need to walk more
View GitHub Profile
@okplanbo
okplanbo / gist:86fa46b4b0fd7b7094ffacc6a3af2005
Last active November 12, 2023 21:06 — forked from mberman84/gist:45545e48040ef6aafb6a1cb3442edb83
LLaMA 2 13b chat fp16 Install Instructions
install miniconda https://docs.conda.io/projects/miniconda/en/latest/
install git https://git-scm.com/downloads
conda create -n textgen python=3.10.9
conda activate textgen
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
git clone https://github.com/oobabooga/text-generation-webui
cd text-generation-webui
pip install -r requirements.txt
python server.py
# download model
@okplanbo
okplanbo / combine.sh
Created November 7, 2023 20:00
simply combines multiple txt files into one. stamps last mod date and filename at the beginning of each record. supports utf8 and win1251
#!/bin/bash
output_file="combined.txt"
# Create an empty output file
> "$output_file"
for file in *.txt; do
# Determine the encoding of the file
encoding=$(file -i "$file" | awk -F'=' '{print $2}')
@okplanbo
okplanbo / mac_install_config.txt
Last active June 9, 2023 21:06
Webdev tools for mac install sequence in natural language
Homebrew
Git cli
Chrome + extensions
Sublime Text
VScode + Extensions
Node, NPM, nvm
Yarn
Serve - https://github.com/vercel/serve/
Openshift cli
Python
@okplanbo
okplanbo / make_file_list.bat
Last active May 1, 2024 13:05
Win script for making file list. Recursively searches non-hidden, non-sys files in a current folder and makes a list of them with paths in txt format
@echo off
setlocal enabledelayedexpansion
set "outputFile=files_list.txt"
:: Change the code page to UTF-8 to handle Cyrillic characters
chcp 65001
if exist "%outputFile%" (
del "%outputFile%"
)
Code:
VSCode, Git, Node, NVM, PuTTY
Notepad++, Sublime
Foobar, VLC, 7z, Steffen Gerlach Scanner
TG, Discord
FireFox, Chrome (OneTab, Adblock, React devtools, Grid Ruler, Measure dimensions, FullPage)
f.lux (or use built-in nightshift feature in win10)
Paint NET
Libre Office
ES7+ React/Redux/React-Native snippets:
dsznajder.es7-react-js-snippets
ESLint:
dbaeumer.vscode-eslint
More human-friendly TS errors:
https://github.com/yoavbls/pretty-ts-errors
Prettier - Code formatter:
@okplanbo
okplanbo / Fisher–Yates (Knuth) array shuffle
Created August 26, 2018 10:17
O(n) complexity, ES6 version
function shuffle(arr) {
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return arr;
}
@okplanbo
okplanbo / intersection.py
Created July 23, 2018 10:20
Find common characters in two strings
#Given two strings find characters present in both. E.g, for "harpoon" and "countryside", the answer is "nro".
#https://www.talentrider.com
def intersection(a, b):
return ''.join(set(a) & set(b))
@okplanbo
okplanbo / alarm.py
Created July 13, 2018 16:44
Simple silent alarm widget for windows using tkinter
# Simple silent alarm widget for windows
# Set time in seconds and text below or pass them in cmd like this: python timer 5 hello
import sys
import time
from tkinter import *
from tkinter.messagebox import showinfo
if (len(sys.argv) > 1):
delay = float(sys.argv[1])
@okplanbo
okplanbo / snake.html
Last active April 20, 2024 16:06
snake game (javascript, canvas, setInterval)
<canvas id="gc" height="600" width="600" style="margin:auto; display: block;"></canvas>
<script type="text/javascript">
window.onload = function() {
canvas = document.getElementById('gc');
context = canvas.getContext('2d');
document.addEventListener('keydown', keyPush);
setInterval(game, 40);
}
let movX = 0;