Skip to content

Instantly share code, notes, and snippets.

View evinism's full-sized avatar

Evin Sellin evinism

View GitHub Profile
@evinism
evinism / text_ml.py
Created September 20, 2023 20:52
basic ray example
from starlette.requests import Request
from typing import Dict
import ray
from ray import serve
from ray.serve.handle import RayServeHandle
from transformers import pipeline
# GitKit
## Experimental git branch management tool
function gk(){
if [ $# -eq 0 ]; then
echo "Usage: gk <command> [args]"
echo "Commands:"
echo " branch <branch> - create a new branch off the current branch"
echo " parent [branch] - get the parent of the current branch or the given branch"
import Data.List
window :: Int
window = 14
main = do
input <- readFile "input.txt"
print $ solve window input
noDupes :: Eq a => [a] -> Bool
import qualified Data.Text as T
main = do
input <- readFile "input.txt"
print $ solve input
type StackState = [[Char]]
data Action = Action {
num :: Int,
source :: Int,
import qualified Data.Text as T
main = do
input <- readFile "input.txt"
print $ countpredranges oneissubset input
print $ countpredranges theyoverlap input
type Range = (Int, Int)
countpredranges :: (Range -> Range -> Bool) -> String -> Int
import qualified Data.Set as Set
import Data.Char
main = do
input <- readFile "input.txt"
print $ fn input
fn :: String -> Int
fn = sum . (fmap procline) . lines
import Data.List
import qualified Data.Text as T
main = do
input <- readFile "input.txt"
print $ fn input
fn :: String -> Int
fn input = sum $ fmap scoreline $ lines input
import qualified Data.Text as T
import Data.List
main = do
input <- readFile "input.txt"
putStrLn $ show $ fn input
fn :: String -> Integer
fn =
sum
@evinism
evinism / jones_sato_wada_wiens.py
Last active September 9, 2022 20:04
Jones-Sato-Wada-Wiens prime polynomial encoded in Python
# Below is the Jones-Sato-Wada-Wiens prime polynomial encoded in Python
# Ultimately, expressing it in this format is somewhat useless because of the
# size of numbers involved.
# https://thomas1111.wordpress.com/2015/02/01/what-do-solutions-of-the-jones-sato-wada-wiens-polynomial-look-like/
def jones_sato_wada_wiens(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z):
return (k * 1) * (
1
-(w*z+h+j-q)**2
git config alias.ass "\!echo ' | | | \n / \ \n / \`, \ \n | ) ) \n | _/_ _ / \n \ | |\n | | ,'"