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 / 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'))
@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 / 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 / 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 / julia 1.11 removed public unicode shortcuts.jl
Last active February 10, 2025 21:37
julia 1.11 removed public unicode shortcuts
\quotedblleft
\quotedblright
# both Tab completion sequence(s) are absent. when this happened is unclear b'cos time is finite. Just add it and move on.
link = "https://docs.julialang.org/en/v1.0/manual/unicode-input/#Unicode-Input-1"
# Regression in code is a bug or issue that occurs when new code changes break existing functionality or introduce unintended side effects
julia> Unicode.julia_chartransform('“')
'“': Unicode U+201C (category Pi: Punctuation, initial quote)
# incorrect name it's a double left quote not a neutral quote
using Unicode
# Same. nothing plainly obvious or intuitive can fix this.
@ket395
ket395 / research.md
Last active February 12, 2025 13:09 — forked from hackermondev/research.md
Unique 0-click deanonymization attack targeting Signal, Discord and hundreds of platform

dan 15-year-old high school student. in my free time, i hack billion dollar companies and

3 mon ago, I discovered a unique 0-click deanonymization attack

verified correction - part of a attack not complete. Not always 0-click it depends, I skimmed it like Superman. [secret gist - 7 more lines, feel free to read it - 2025-02-12T18:33:±30 ±05:00->5:30]

@ket395
ket395 / Game dev 13Feb.md
Created February 12, 2025 23:16
Game dev 13Feb

What the hell is a Type Object

First of all this book is targeted for budding game devs.

Second, with a double layer DVD the challenge is made to be filling it with game. But it doesn't have to be.

Third, this chapter only works for ideal projects that are simple and when the game has been formally specified.

Based on this chapter and the above 3 points, you need to level up. Don't just blindly jump into game dev, it will consume you like a bundle of dry twigs.

@ket395
ket395 / GH vscode issue #41542 explained.md
Last active February 18, 2025 03:50
GH vscode issue #41542 explained

microsoft/vscode#41542 (comment)

This bug is still present in the current VSCode because the editor does not respect the changes in the settings when you customize it for your workspace until you close the entire app and reopen app and then reopen the same folder. Destroying the flow state.

Understandably this is a tedious mechanical process and could certainly be never improved due to fundamental limitations of modern programming. Or could it be improved?

@ket395
ket395 / Julia 2d hearts animation.jl
Last active February 15, 2025 02:01
Julia 2D hearts animation
# rotation angle 'd' goes from 0 to 2π (one revolution)
0:2e-3:2π .|> d-> (
# screen buffer, with empty braille characters and new lines
(P = fill(5<<11,64,25))[64,:] .= 10;
# transformation vector: cis = rotation, sin = zoom
z = 8cis(d)sin(.46d);
# loop over all pixels
for r=0:98, c=0:5^3
# (..)z = scale and rotate point, using complex numbers
# reim = split complex number into x/y