Skip to content

Instantly share code, notes, and snippets.

View UlyssesWu's full-sized avatar
💤
working til death

Ulysses UlyssesWu

💤
working til death
View GitHub Profile
@UlyssesWu
UlyssesWu / oculus_quest_2_adjust_date_time_no_factory_reset.md
Created August 13, 2023 18:14 — forked from tzhao11/oculus_quest_2_adjust_date_time_no_factory_reset.md
Adjust oculus quest 2 system date and time without doing factory reset.

Adjust Oculus (Meta) Quest 2 System Date/Time without Doing Factory Reset

TL;DR

adb shell service call alarm 2 i64 {current unix epoch * 1000}

Background

# mainly generated by GPT-4
trigger: none
schedules:
- cron: "0 0 * * *" # This will trigger the pipeline every day at midnight
displayName: Daily midnight sync
branches:
include:
- main
using System;
namespace MersenneTwister
{
// Implementation porting from C version of mt19937-64
// coded by Makoto Matsumoto and Takuji Nishimura
//
// Copyright (C) 2004, Makoto Matsumoto and Takuji Nishimura,
// All rights reserved.
// 2023 fixed by UlyssesWu
public static string FormatAsHex(ReadOnlySpan<byte> data, int lineWidth = 16, int byteWidth = 1)
{
byte ReplaceControlCharacterWithDot(byte character) => character < 31 || character >= 127 ? (byte)46 /* dot */ : character;
byte[] ReplaceControlCharactersWithDots(byte[] characters) => characters.Select(ReplaceControlCharacterWithDot).ToArray();
IEnumerable<BigInteger> Chunk(IReadOnlyList<byte> source, int size) => source.Select((item, index) => source.Skip(size * index).Take(size).ToArray()).TakeWhile(bucket => bucket.Any()).Select(e => new BigInteger(e));
var result = new StringBuilder();
for(var pos = 0; pos < data.Length;)
{
var line = data.Slice(pos, Math.Min(lineWidth * byteWidth, data.Length - pos)).ToArray();
@UlyssesWu
UlyssesWu / xamarinandroidbindings.md
Created November 20, 2020 15:08 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@UlyssesWu
UlyssesWu / xamarinandroidbindings.md
Created November 20, 2020 15:08 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@UlyssesWu
UlyssesWu / Privacy Policy.md
Created February 17, 2020 18:17
Privacy Policy

Privacy Policy of NightCorer

I, as UlyssesWu (wdwxy12345@gmail.com), do not collect any data from NightCorer users. NightCorer is a complete offline software.

@UlyssesWu
UlyssesWu / Liquid.shader
Created December 7, 2018 05:33
Liquid shader
//https://twitter.com/minionsart/status/986374665399685121
Shader "Unlit/SpecialFX/Liquid"
{
Properties
{
_Tint ("Tint", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "white" {}
_FillAmount ("Fill Amount", Range(-10,10)) = 0.0
[HideInInspector] _WobbleX ("WobbleX", Range(-1,1)) = 0.0
@UlyssesWu
UlyssesWu / test.tjs
Created September 10, 2018 09:43 — forked from rednaxelafx/test.tjs
TJS2 examples. Just a reminder. docs: http://devdoc.kikyou.info/tvp/docs/tjs2doc/contents/
class Foo {
var val;
property p {
getter {
return val;
}
setter(v) {
this.val = v;
}
@UlyssesWu
UlyssesWu / Inject.cpp
Created January 24, 2018 02:04 — forked from capntrips/Inject.cpp
Unity 2017.1.0p5 type information
// A quick and dirty DLL injector
// This method relies on static linkage and the fact that kernel32 doesn't move
// Compile with the same bitness as the target and the dll.
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
#include <stdio.h>
int GetPid(char *modName)
{