Skip to content

Instantly share code, notes, and snippets.

Avatar

ohbashunsuke baobao

View GitHub Profile
View create_article.sh
#!/bin/bash
# コピーしたいテンプレート記事パス
template='templates/article_template.md'
# 日付
date=`date '+%Y%m%d'`
# 検索対象フォルダ
dir='drafts/'
@baobao
baobao / UnityMicRecording.cs
Last active Sep 11, 2020
Unityで録音し、メモリ上に保持した録音サウンドを再生するサンプルコード
View UnityMicRecording.cs
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Unityで録音し、メモリ上に保持した録音サウンドを再生するサンプルコード
/// OnGUIでデバッグボタンを表示しています
/// </summary>
public class UnityMicRecording : MonoBehaviour
{
/// <summary>
View serial-microbit.js
// setup serial
serial.setBaudRate(BaudRate.BaudRate115200)
// 0:none, 1:Success, 2:Fail
basic.forever(function ()
{
let str = serial.readString()
if (str.indexOf("1") >= 0) {
basic.showIcon(IconNames.Heart)
basic.pause(1000)
@baobao
baobao / RenameTxt2Cs.csx
Created Aug 1, 2020
Rename Sample `.txt` to `.cs`
View RenameTxt2Cs.csx
#!/usr/bin/env dotnet-script
/**
* Rename Sample .txt to .cs
*/
if (Args == null || Args.Count < 0)
{
Console.WriteLine("Require arguments");
return;
}
View IRrecvDumpV2.ino
//------------------------------------------------------------------------------
// Include the IRremote library header
//
#include <IRremote.h>
//------------------------------------------------------------------------------
// Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838)
//
int recvPin = 11;
IRrecv irrecv(recvPin);
@baobao
baobao / Janken.c
Created May 3, 2020
Cでじゃんけんゲーム
View Janken.c
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<unistd.h>
// じゃんけんの手
char te[3][20] = {"グー", "チョキ", "パー"};
int main()
{
View UI-Mask.shader
Shader "UI/Mask"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
View DOTweenAwaiterExtension.cs
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using DG.Tweening;
using UnityEngine;
/// <summary>
/// DOTweenをasync/awaitに返還すDOTweenAwaiterの拡張メソッド
/// </summary>
public static class DOTweenAwaiterExtension
View PrimoCubettoOOBExample.ino
#include <SPI.h>
#include <CubettoLibrary.h>
#include <AccelStepper.h>
#include <aci.h>
#include <KickstarterBackers.h>
Cubetto CubettoRobot;
/** ************************************************************************************************************************************
* @function
* @brief
View PrefabModeTest.cs
using UnityEngine;
public class PrefabModeTest : MonoBehaviour
{
void Awake()
{
Debug.Log($"Awake : Prefabモードのワタシ {this}", this);
}
void OnEnable()