Skip to content

Instantly share code, notes, and snippets.

@Journeyman1337
Journeyman1337 / image.cpp
Created February 2, 2022 20:25
lambda template usage for image between color type conversion with multiple possible bit depths
/*
Copyright (c) 2022 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@motorailgun
motorailgun / idea.md
Last active June 18, 2024 06:22
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
@leok7v
leok7v / build-apk.bash
Last active August 11, 2024 03:29
Single file bash script to build Android Hello World apk (target API=21) on osx
#!/bin/bash
# https://medium.com/@authmane512/how-to-build-an-apk-from-command-line-without-ide-7260e1e22676
# dependencies:
# https://installvirtual.com/install-openjdk-8-on-mac-using-brew-adoptopenjdk/
# brew updata
# brew tap AdoptOpenJDK/openjdk
# brew cask install adoptopenjdk8
# https://developer.android.com/ndk/downloads
# https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
# and use:
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active November 12, 2024 22:09
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@Gydo194
Gydo194 / args.asm
Last active November 3, 2024 20:54
Command Line arguments in NASM assembly on 64-bit Linux
; print all command line arguments (5 characters) and exit
; for 64-bit systems, Linux syscalls
; for simplicity, this program does not calculate the length of the strings.
; assemble with: nasm -f elf64 -o args args.asm
; link with: ld -o args args.o
sys_write equ 1 ; the linux WRITE syscall
sys_exit equ 60 ; the linux EXIT syscall
sys_stdout equ 1 ; the file descriptor for standard output (to print/write to)
@ousttrue
ousttrue / CMakeLists.txt
Created June 3, 2019 13:39
emscripten glfw3 or webgl sample
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(em_gl VERSION 0.1.0)
LINK_DIRECTORIES(
$ENV{VCPKG_ROOT}/installed/x64-windows/lib
)
FILE(GLOB SRC
*.cpp
*.h
@arrieta
arrieta / lexer.cpp
Last active October 22, 2024 14:27
Simple C++ Lexer
// A simple Lexer meant to demonstrate a few theoretical concepts. It can
// support several parser concepts and is very fast (though speed is not its
// design goal).
//
// J. Arrieta, Nabla Zero Labs
//
// This code is released under the MIT License.
//
// Copyright 2018 Nabla Zero Labs
//
page ,132
title memcpy - Copy source memory bytes to destination
;***
;memcpy.asm - contains memcpy and memmove routines
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; memcpy() copies a source memory buffer to a destination buffer.
; Overlapping buffers are not treated specially, so propogation may occur.
@mrshpot
mrshpot / egl_opengl_test.cpp
Created June 26, 2018 19:58
EGL Offscreen Rendering RPi
/*
* Example program for creating an OpenGL context with EGL for offscreen
* rendering with a framebuffer.
*
*
* The MIT License (MIT)
* Copyright (c) 2014 Sven-Kristofer Pilz
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@csukuangfj
csukuangfj / default-linker-script.txt
Last active May 7, 2024 04:19
This file shows the default linker script of `ld`, use `ld --verbose` to show it.
GNU ld (GNU Binutils for Ubuntu) 2.25.1
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
i386pep
i386pe