Skip to content

Instantly share code, notes, and snippets.

View ket395's full-sized avatar
💭
I may be slow to respond.

Manish ket395

💭
I may be slow to respond.
View GitHub Profile
@ket395
ket395 / write means append.jl
Last active February 10, 2025 13:03
write means append
readlines(f)
1-element Vector{String}:
"what a boring f'ing textwhat a boring f'ing text."
# NOTE: write a function that optionally inserts newlines after each string in write or append mode.
@ket395
ket395 / better never than now.py
Created February 9, 2025 20:35
better never than now
epic_failure = "https://www.python.org/downloads/metadata/sigstore/"
type(epic_failure) == AsininePEPs
@ket395
ket395 / type sys.jl
Last active February 9, 2025 20:38
Julia and its toy type system
ERROR: MethodError: no method matching first(::Vector{HTMLNode}, ::Nothing)
The function `first` exists, but no method is defined for this combination of argument types.
Closest candidates are:
first(::AbstractVector, ::Integer)
@ Base abstractarray.jl:504
first(::AbstractArray)
@ Base abstractarray.jl:452
first(::Any)
@ Base abstractarray.jl:471
@ket395
ket395 / ROT13.jl
Last active February 18, 2025 03:49
Tau Life:better last than never
# Function to apply ROT13 (Caesar cipher with shift of 13)
function rot13(s::String)
return map(c -> shift_char(c, 13), s)
end
# Helper function to shift a single character by a given amount
function shift_char(c::Char, shift::Int)
if 'a' <= c <= 'z'
# Shift within lowercase letters
return Char((Int(c) - Int('a') + shift) % 26 + Int('a'))