Skip to content

Instantly share code, notes, and snippets.

View hugefiver's full-sized avatar
😴
Moing (🐟)

Hugefiver hugefiver

😴
Moing (🐟)
View GitHub Profile
@hugefiver
hugefiver / file_magic_numbers.md
Created April 14, 2024 09:15 — forked from leommoore/file_magic_numbers.md
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files

@hugefiver
hugefiver / emulator-install-using-avdmanager.md
Created August 12, 2023 19:43 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@hugefiver
hugefiver / oh-my-diana.user.js
Created February 11, 2023 13:21 — forked from journey-ad/oh-my-diana.user.js
在哔站右下角添加嘉然小姐的live2d模型
// ==UserScript==
// @name #相亲相爱一嘉人#
// @description 在哔站右下角添加嘉然小姐的live2d模型
// @version 1.0.1
// @namespace https://github.com/journey-ad
// @author journey-ad
// @include /^https:\/\/(www|live|space|t)\.bilibili\.com\/.*$/
// @icon https://www.google.com/s2/favicons?domain=bilibili.com
// @license GPL v2
// @run-at document-end
@hugefiver
hugefiver / !README.md
Created October 13, 2022 07:47 — forked from mmozeiko/!README.md
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

Run python.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0.

You can list available versions with python.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe from output folder, first run setup.bat - after that PATH/INCLUDE/LIB env variables will be setup to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).