Skip to content

Instantly share code, notes, and snippets.

@Hackerl
Hackerl / ohos-ndk-llvm19.md
Created December 31, 2025 08:54
Update OHOS NDK's LLVM to version 19.1.7 and make it compatible with CMake and vcpkg.

Get Command Line Tools

Download and extract from the official website.

Get Customized LLVM 19

Download and extract from the official website.

Replace LLVM

Delete the sdk/default/openharmony/native/llvm directory in Command Line Tools and replace it with the newly downloaded version.

Adapt CMake

@Hackerl
Hackerl / promise.h
Created April 3, 2022 06:30
cpp promise in javascript style
#include <memory>
#include <functional>
#include <list>
namespace zero {
namespace promise {
template<typename Result, typename Reason>
class Promise;
template<typename T>
@Hackerl
Hackerl / fake_ps4.py
Created March 10, 2021 08:01
disguise the machine as ps4
#!/usr/bin/env python3
import socket
UDP_IP = "0.0.0.0"
UDP_PORT = 987
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.bind((UDP_IP, UDP_PORT))
while True:
@Hackerl
Hackerl / do_syscall.h
Last active March 5, 2021 04:15
syscall function asm definition
#ifndef __SYSCALL_H__
#define __SYSCALL_H__
#ifdef __cplusplus
extern "C" {
#endif
long int do_syscall(long int sys_no, ...);
#ifdef __cplusplus
@Hackerl
Hackerl / circular_buffer.h
Last active January 19, 2021 09:50
lock-free circular buffer
#ifndef __CircularBuffer_H__
#define __CircularBuffer_H__
//******************************************************************************
#include <atomic>
#include <climits>
template <class T, unsigned long N>
class CCircularBuffer {
private:
static constexpr auto MODULO = ULONG_MAX - (ULONG_MAX % N);