Skip to content

Instantly share code, notes, and snippets.

View imxieyi's full-sized avatar

Yi Xie imxieyi

View GitHub Profile
@darrarski
darrarski / CustomIntensityVisualEffectView.swift
Last active June 5, 2024 07:00
UIVisualEffectView subclass that allows to customise effect intensity
import UIKit
final class CustomIntensityVisualEffectView: UIVisualEffectView {
/// Create visual effect view with given effect and its intensity
///
/// - Parameters:
/// - effect: visual effect, eg UIBlurEffect(style: .dark)
/// - intensity: custom intensity from 0.0 (no effect) to 1.0 (full effect) using linear scale
init(effect: UIVisualEffect, intensity: CGFloat) {
theEffect = effect
@drguildo
drguildo / PasswordDialog
Last active March 1, 2023 10:09
JavaFX doesn't have a password dialog, so I wrote one.
package io.sjm.diary;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.scene.control.ButtonBar.ButtonData;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
import javafx.scene.control.PasswordField;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
@hacha
hacha / Binding.cs
Created February 25, 2014 12:01
UnityのNativePluginで、Unity側のC#スクリプトからbyte配列を渡したり、プラグイン側からbyte配列を受け取る方法
using UnityEngine;
using System.Runtime.InteropServices;
using System.Text;
using System.IO;
using System;
public class Binding {
[DllImport("__Internal")]
private static extern bool Test(byte[] ptrSrc, int srcLength, ref IntPtr ptrDest, ref int destLength);