Skip to content

Instantly share code, notes, and snippets.

View JuniperPhoton's full-sized avatar

JuniperPhoton JuniperPhoton

View GitHub Profile
@JuniperPhoton
JuniperPhoton / FloatingOverlayApp.swift
Last active March 31, 2025 08:47
A simple application to show a black, resizable, title-less, always-on-top NSWindow on Mac.
//
// FloatingOverlayApp.swift
// FloatingOverlay
//
// Created by JuniperPhoton on 2025/3/12.
//
import SwiftUI
// Dependency: https://github.com/sindresorhus/KeyboardShortcuts
@JuniperPhoton
JuniperPhoton / RGBToXYZMatrix.swift
Created December 10, 2024 08:37
Calculate the matrix for the linear RGB to CIE XYZ transformation.
/// Calculate the matrix for the linear RGB to CIE XYZ transformation.
///
/// Example code to calcualte the matrix for sRGB:
///
/// ```swift
/// let d65WhitePoint = [0.9505, 1.0, 1.0891]
///
/// matrix = calculateLinearRGBToCIEXYZMatrix(xr: 0.64, yr: 0.33,
/// xg: 0.30, yg: 0.60,
/// xb: 0.1558, yb: 0.06,
@JuniperPhoton
JuniperPhoton / hprof_conv.cs
Created July 11, 2019 11:55
Convert Android hprof to Java SE hprof
using System;
using System.Diagnostics;
using System.IO;
namespace AdbTest {
class Program {
static void Main (string[] args) {
if (args.Length == 0) {
Console.WriteLine ("Please specified folder path");
Environment.Exit (-1);