Skip to content

Instantly share code, notes, and snippets.

@kaikoga
kaikoga / LocalizedPropertyField.cs
Created January 9, 2023 09:59
The best PropertyField implementation for UIElements (considering on-the-fly localization)
using UnityEditor;
using UnityEngine.UIElements;
public class LocalizedPropertyField : VisualElement
{
// Because it is currently the only simple way to dynamically update label content
public LocalizedPropertyField(SerializedProperty property, LocalizedContent locLabel)
{
Add(new IMGUIContainer(() =>
{
@mala
mala / note_vuln.md
Last active August 12, 2021 08:15
noteとインシデントハンドリングと広報の仕事

noteとインシデントハンドリングと広報の仕事

前提

  • この文章はmalaが書いています。個人の見解であり所属している企業とは関係ありません。
  • noteには知り合いが何人かいるし、中の人と直接コンタクトも取っているし相談もされているが、(10月2日時点で)正規の仕事としては請け負っていない。

10月2日追記

  • 正規の仕事として請け負う可能性もありますが、自身の主張や脆弱性情報の公開に制限が掛かるのであれば引き受けないつもりです。
@mala
mala / covid19-twitter-research_01.md
Last active December 31, 2021 05:58
生活と意見: ソーシャルディスタンスなどと称してユーザー名や文章にスペースを挟む行為についての苦情

生活と意見: ソーシャルディスタンスなどと称してユーザー名や文章にスペースを挟む行為についての苦情

更新履歴

2020-05-13 追記

@Treeki
Treeki / TurnipPrices.cpp
Last active May 27, 2024 15:18
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@baba-s
baba-s / EditorGUILayoutWrapper.cs
Last active December 6, 2019 07:45
Unity 2018.4.8f1, EditorGUILayout methods + GUILayout.Button, GUILayout.Box, GUILayout.RepeatButton
using System;
using UnityEditor;
using UnityEngine;
public static class EditorGUILayoutWrapper
{
public static bool Button( Texture image, params GUILayoutOption[] options )
{
return GUILayout.Button( image, options );
}
@yasirkula
yasirkula / TMP_IntegerText.cs
Last active May 12, 2024 22:04
Show numbers (int, float etc.) on TextMesh Pro texts without any GC allocations
//#define TMP_ROUND_DECIMALS // When defined, float and double values are rounded using Math.round
using TMPro;
public static class TMP_IntegerText
{
private static readonly char[] arr = new char[64]; // prefix + number + postfix can't exceed this capacity!
private static int charIndex = 0;
public static void SetText( this TMP_Text text, sbyte number )
@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@sifue
sifue / 無料で読めるポール・グレアムの「ハッカーと画家」+αの日本語訳のみのまとめ.md
Last active July 4, 2024 15:26
無料で読めるポール・グレアムの「ハッカーと画家」+αの日本語訳のみのまとめ
@johnfoderaro
johnfoderaro / httpd.conf
Created December 24, 2016 15:09
Default httpd.conf file - macOS Sierra 10.12.2 - /etc/apache2/httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure