Skip to content

Instantly share code, notes, and snippets.

@mminer
mminer / Console.cs
Last active March 28, 2024 22:23
Unity script to display in-game debug console. Actively maintained version: https://github.com/mminer/consolation
// NOTE: For an actively-maintained version of this script, see https://github.com/mminer/consolation.
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// A console to display Unity's debug logs in-game.
/// </summary>
public class Console : MonoBehaviour
{
fizz = function f() {
fizz = function () {
fizz = function () {
fizz = f
return "Fizz"
}
}
}
buzz = function f() {
@tsubaki
tsubaki / ScriptableObjectToAsset.cs
Last active May 25, 2024 15:22
ScriptableObjectをAssetsファイルとして出力する汎用スクリプト
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
/// <summary>
// ScriptableObjectをプレハブとして出力する汎用スクリプト
/// </summary>
// <remarks>
// 指定したScriptableObjectをプレハブに変換する。
@ytsuboi
ytsuboi / DAP_config.patch
Created April 2, 2013 09:33
a patch for DAP_config.h of NXP's AN11321, to get works on my CMSIS-DAP adapter.
--- DAP_config.h.orig 2013-04-02 16:54:01.248627100 +0900
+++ DAP_config.h 2013-03-31 13:48:38.999248900 +0900
@@ -38,6 +38,7 @@
//#include <LPC43xx.H> // Debug Unit Cortex-M Processor Header File
#include <LPC11Uxx.h>
+#include "gpio.h"
/// Processor Clock of the Cortex-M MCU used in the Debug Unit.
/// This value is used to calculate the SWD/JTAG clock speed.
#nowarn "9"
module private Internals =
open System.Runtime.InteropServices
type CRED_TYPE =
| GENERIC = 1
| DOMAIN_PASSWORD = 2
| DOMAIN_CERTIFICATE = 3
@TheLastMutt
TheLastMutt / mini51.c
Last active March 30, 2019 09:48
OpenOCD stuff for Mini51
/***************************************************************************
* Copyright (C) 2013 Cosmin Gorgovan *
* cosmin [at] linux-geek [dot] org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
@claymcleod
claymcleod / pycurses.py
Last active May 18, 2024 09:55
Python curses example
import sys,os
import curses
def draw_menu(stdscr):
k = 0
cursor_x = 0
cursor_y = 0
# Clear and refresh the screen for a blank canvas
stdscr.clear()
@elfmimi
elfmimi / Z70-Pro-ANSI-_3_0_3_0_.kbd.json
Last active March 31, 2018 19:05
Z70 Pro ANSI (3.0/3.0)
[
{
"name": "Z70 Pro (ANSI 3.0/3.0)"
},
[
"Esc",
"!\n1\n\n\nf1",
"@\n2\n\n\nf2",
"#\n3\n\n\nf3",
"$\n4\n\n\nf4",
@ksasao
ksasao / detect_marker.py
Last active December 10, 2023 02:38
ZOZOSUITのマーカーのIDを読み取るコードです。公開されている画像を元に独自に解析しているので、公式ではこのように処理しているかどうかは不明です。仕様等については https://twitter.com/ksasao/status/990779583682170881 のスレッドも参照してください。全身を読み取るコード https://twitter.com/ksasao/status/989842844243279872 ライセンスは Apache License 2.0 です。
import numpy as np
import random
import math
import cv2
from PIL import Image
import sys
def detect_markers(im):
markers = []
# 輪郭線抽出のための二値化
@ksasao
ksasao / HTTPSTest.ino
Last active August 29, 2020 05:16
M5Stack HTTPS Client with Azure Functions
#include <M5Stack.h>
#include <WiFiClientSecure.h>
WiFiClientSecure client;
const char* ssid = "your SSID"; // WiFi SSID
const char* password = "your WiFi password"; // WiFi PW
const char* host = "host name (e.g. example.azurewebsites.net)";
const char* path = "url (e.g. /api/EnvMonitor?code=AAA==)";