Skip to content

Instantly share code, notes, and snippets.

View th3terrorist's full-sized avatar

Roberto Montalti th3terrorist

View GitHub Profile
@th3terrorist
th3terrorist / capsid.md
Created January 14, 2025 22:07
Viral capsid proteins

A viral capsid protein is a structural protein that forms the capsid, which is the protein shell enclosing and protecting the genetic material (DNA or RNA) of a virus. The capsid plays a critical role in the viral life cycle and is essential for infectivity.

  1. Composition:

    • Capsids are typically composed of repeating units of capsid proteins, which self-assemble into highly symmetrical structures.
    • The arrangement can be icosahedral, helical, or more complex, depending on the virus.
  2. Functions:

    • Protection: Shields the viral genome from degradation by enzymes (nucleases) or environmental factors.
    • Host Interaction: Facilitates attachment to host cells by interacting with specific receptors, enabling viral entry.
  • Genome Delivery: Assists in delivering the viral genome into the host cell, often by disassembling or rearranging during infection.
@th3terrorist
th3terrorist / remind.sh
Created October 13, 2024 20:50
I forget :/
remind ()
{
if [ $1="-h" ] || [ $1="--help" ]; then
echo "usage: remind <command_prefix>"
return 0
fi
if [ -z "$1" ]; then
echo "usage: remind <command_prefix>">&2
return 1
@th3terrorist
th3terrorist / darkened-zed-theme.json
Created June 6, 2024 14:26
Darkened theme, zed version
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Darkened",
"author": "Roberto Montalti",
"themes": [{
"name": "Darkened",
"appearance": "dark",
"style": {
"background.appearance": "opaque",
@th3terrorist
th3terrorist / wackyoption.cpp
Created January 5, 2024 20:32
test at a simple option type
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef bool b8;
typedef unsigned int u32;
struct _None {};
#define None (_None{});
template<typename T>
struct Option {
@th3terrorist
th3terrorist / t3u_plus_install.sh
Created October 17, 2023 20:13
T3U TPLink Wi-Fi Adapter driver installer
#!/bin/bash
git clone https://github.com/cilynx/rtl88x2bu.git
cd rtl88x2bu
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu
@th3terrorist
th3terrorist / deepMerge.js
Last active October 9, 2023 10:21
Deeply merge js objects
/**
* Merges two arrays by concatenating their elements uniquely using `new Set(...)`.
*
* @param {Array} a1 - The first array to merge.
* @param {Array} a2 - The second array to merge.
* @returns {Array} A new array containing elements from both input arrays.
*/
const mergeArray = (a1, a2) => Array.from(new Set([...a1, ...a2]))
/**
@th3terrorist
th3terrorist / match.js
Last active August 1, 2023 20:26
Unnecessary js match expression
const ofClass = (classDef, instance) => {
if (typeof classDef === 'function'
&& typeof instance === 'object') {
return new classDef().constructor === instance.constructor
}
if (classDef === Number)
return typeof instance === 'number'
if (classDef === String)
return typeof instance === 'string'
@th3terrorist
th3terrorist / coc.vim
Created July 16, 2023 11:13
Coc useful shortcut mappings
" https://github.com/neoclide/coc.nvim#example-vim-configuration
inoremap <silent><expr> <c-space> coc#refresh()
" gd - go to definition of word under cursor
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
" gi - go to implementation
nmap <silent> gi <Plug>(coc-implementation)
@th3terrorist
th3terrorist / passgen.js
Created October 16, 2022 15:29
Very safe password gen
import crypto from "crypto";
let randGenData = {
index: 0,
bytes: [],
poolSize: 512
};
// Generates a word by [' ', ~) from https://www.asciitable.com/
const genRandPass = (length) => {
@th3terrorist
th3terrorist / gd.py
Last active August 18, 2022 19:59
An overly simplistic gradient descent algorithm for linear regression on a single variable, taken from andrew's ng course
import math, numpy as np
from typing import Tuple, Callable
from numpy.typing import ArrayLike
x_train = np.array([1.0, 2.0])
y_train = np.array([300.0, 500.0])
def compute_cost(x: ArrayLike, y: ArrayLike, w: float, b: float) -> float:
m = x.shape[0]
cost = 0