Skip to content

Instantly share code, notes, and snippets.

Avatar
🧬

Yuuki Wesp 0xF6

🧬
View GitHub Profile
View banking_dispenser.csx
var rarity = new [] { 5000, 2000, 1000, 500, 100 };
int[] dispenser_action(int sum)
{
if (sum % rarity.OrderBy(x => x).First() != 0)
throw new Exception();
var result = new List<int>();
foreach (var r in rarity)
{
var x = (sum - (sum % r)) / r;
result.AddRange(Enumerable.Range(0, x).Select(_ => r));
View easy_vm.cpp
enum
{
NOP,
ADD
};
struct thestack {
union {
int i;
@0xF6
0xF6 / auto_craft.ahk
Created Jan 29, 2021
Cyberpunk 2077 auto craft script
View auto_craft.ahk
#MaxThreadsPerHotkey 3
F1::
Toggle := !Toggle
Loop
{
If (!Toggle)
Break
Click down
Sleep 850
@0xF6
0xF6 / method.regex
Created Jan 23, 2021
rex for method declaration
View method.regex
(?x)
(?<return-type>
(?<type-name>
(?:
(?:ref\s+(?:readonly\s+)?)?
(?:
(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\s*\:\:\s*)?
(?<name-and-type-args>
\g<identifier>\s*
(?<type-args>\s*<(?:[^<>]|\g<type-args>)+>\s*)?
@0xF6
0xF6 / AdBannerSafeRegion.cs
Last active Nov 2, 2020
Apply a safe region calculation using classic ad banner.
View AdBannerSafeRegion.cs
/// <summary>
/// Only <see cref="BannerPosition.BOTTOM_*"/>
/// </summary>
public static void ApplyAdsSafeRegion(this RectTransform target, Rect safeRegion)
{
static float getAdHeight() =>
((Screen.height / (Screen.dpi / 160f)) > 720f) ? 90f * (Screen.dpi / 160f)
: ((Screen.height / (Screen.dpi / 160f)) > 400f) ? 50f * (Screen.dpi / 160f)
: 32f * (Screen.dpi / 160f);
r.y += getAdHeight();
View fn_name.h
#pragma once
#if defined(__GNUC__) || (defined(__ICC) && (__ICC >= 600))
#define G_FUNCTION_NAME __PRETTY_FUNCTION__
#elif defined(__FUNCSIG__)
#define G_FUNCTION_NAME __FUNCSIG__
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600))
#define G_FUNCTION_NAME __FUNCTION__
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
#define G_FUNCTION_NAME __func__
@0xF6
0xF6 / bgd.csx
Created Jul 9, 2020
BigInt divide
View bgd.csx
double Divide(BigInteger x, BigInteger y)
=> Math.Exp(BigInteger.Log(x) - BigInteger.Log(y));
@0xF6
0xF6 / Driver_CO2.cpp
Created Jan 29, 2020
Display CO2 ppm value contains in air.
View Driver_CO2.cpp
#include "Arduino.h"
#include "TM74.h"
#define DIO 5
#define RCLK 6
#define SCLK 7
#define ALARM 10
TM74 display(SCLK, RCLK, DIO);
View 📊 Weekly development breakdown
HTML 14 mins ████████████████▌░░░░ 79.0%
JSON 3 mins ████▍░░░░░░░░░░░░░░░░ 20.9%
Other 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.1%
Git Config 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.1%
View keybase.md

Keybase proof

I hereby claim:

  • I am 0xf6 on github.
  • I am ivysola (https://keybase.io/ivysola) on keybase.
  • I have a public key ASCfQSPaCC6X4o6E4p_PVTgzGYygbGE5UjriKcaP_1qhNgo

To claim this, I am signing this object: