Skip to content

Instantly share code, notes, and snippets.

@Tharun8951
Tharun8951 / lexer.cpp
Created March 30, 2024 20:12
A C++ lexer for a basic programming language. Tokenizes source code into various token types such as numbers, identifiers, operators, and keywords. Includes functions for splitting strings, checking for numbers and alphabetic characters, and handling skippable characters. The lexer reads input from a file, tokenizes it, and prints the resulting…
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cctype>
#include <fstream>
#include <sstream>
#include <cstring>
#include <cstdlib>

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

@shamil
shamil / mount_qcow2.md
Last active January 6, 2025 13:20
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@Srfigie
Srfigie / .gitattributes
Created February 2, 2020 14:30 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
Reflection in PHP is a way to inspect and manipulate the structure and behavior of PHP code at runtime.
It provides information about classes, interfaces, functions, methods, and extensions, as well as the ability to change
the behavior of objects through dynamic method calls and property manipulation.
This makes it a powerful tool for debugging, unit testing, and creating generic code.
Reflection is a built-in feature of the PHP language and can be used by calling the Reflection API classes and methods.
ReflectionClass: reports information about a class.
ReflectionFunction: reports information about a function.
ReflectionParameter: retrieves information about function’s or method’s parameters.
ReflectionClassConstant: reports information about a class constant.
@SavageCore
SavageCore / 1-readme.md
Last active January 6, 2025 13:14 — forked from cdleveille/Install⁄Update Xone
Install or update xone driver for Steam Deck (desktop shortcut and bash script)

Enjoying this script? Consider buying me a beer/coffee!

ko-fi

First time setting up your Deck? You may enjoy my setup guide. It'll get you started on Emulation.

Improvements

Main changes at initial release versus cdleveille's original script:

  • Added zenity for a basic "GUI"
@jonesandy
jonesandy / XUnitAsserts.cs
Last active January 6, 2025 13:13
A cheat sheet of Asserts for xUnit.net in C#
/*
STRINGS
*/
Assert.Equal(expectedString, actualString);
Assert.StartsWith(expectedString, stringToCheck);
Assert.EndsWith(expectedString, stringToCheck);
// Some can also take optional params
Assert.Equal(expectedString, actualString, ignoreCase: true);
Assert.StartsWith(expectedString, stringToCheck, StringComparison.OrdinalIgnoreCase);
@Pangoraw
Pangoraw / download_zotero.py
Last active January 6, 2025 13:13
Download articles from the web when zotero has not synced them.
#!python
"""
Downloads Zotero files that are not synced on this laptop.
"""
import os
from pathlib import Path
import argparse
import sqlite3
@Pangoraw
Pangoraw / pdf_zotero.sh
Last active January 6, 2025 13:12
Open zotero files from a selector like rofi, dmenu, fzf,...
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
ZOTERO_DIR="$HOME/snap/zotero-snap/common/Zotero"
ZOTERO_DB="${ZOTERO_DIR}/zotero.sqlite"
PDF_READER="$HOME/Projects/piz/target/debug/piz"
@osipxd
osipxd / !paper-versions.md
Last active January 6, 2025 13:12
Paper versions links