Skip to content

Instantly share code, notes, and snippets.

Avatar

wentz kuetsuhara

View GitHub Profile
@kuetsuhara
kuetsuhara / bt.html
Last active Apr 1, 2020
さくっと“ガジェット”が作れる!「micro:bit」と「Node-RED」で、超簡単Web Bluetooth通信
View bt.html
<html>
<head>
<title>micro:bit</title>
<script
type="text/javascript"
src="/microbit.js"
></script>
</head>
<body>
<button id="find">find</button>
@kuetsuhara
kuetsuhara / button_listen.js
Last active Dec 7, 2017
node-red connect to microbit "button listen"
View button_listen.js
var BBCMicrobit = context.global.microbit
var BUTTON_VALUE_MAPPER = ['Not Pressed', 'Pressed', 'Long Press'];
console.log('Scanning for microbit');
BBCMicrobit.discover(function(microbit) {
console.log('\tdiscovered microbit: id = %s, address = %s', microbit.id, microbit.address);
microbit.on('disconnect', function() {
console.log('\tmicrobit disconnected!');
@kuetsuhara
kuetsuhara / microbit_let_text.js
Last active Dec 7, 2017
node-red connet to microbit
View microbit_let_text.js
var BBCMicrobit = context.global.microbit
var text = 'Hello there';
console.log('Scanning for microbit');
BBCMicrobit.discover(function(microbit) {
console.log('\tdiscovered microbit: id = %s, address = %s', microbit.id, microbit.address);
microbit.on('disconnect', function() {
console.log('\tmicrobit disconnected!');
});
View example.json
{"Entries":
[
{
"Name": "a",
"BC": 0,
"LN": 121.45,
"RT": 1.47197,
"SC": 1
},
{
View AFileLoad.m
void AFileLoad::BeginPlay(){
Super::BeginPlay();
// Load
FString aFullPath = FPaths::GameSavedDir();
aFullPath += "example.json";
FString JsonStr;
FFileHelper::LoadFileToString(JsonStr, *aFullPath);
View HelloWorld.h
#pragma once
#include "GameFramework/Actor.h"
#include "Http.h"
#include "HelloWorld.generated.h"
/**
*
*/
UCLASS()
View skyboxmeshCustom
public void Change( Material skybx ){
// 表示されているmeshを削除
GameObject[] examples = GameObject.FindGameObjectsWithTag("SkyMesh");
for( int i = 0; i < examples.Length; i++){
Destroy(examples[i]);
}
// 新たにメッシュを設定
this.material = null;
View CiuchbaseLiteSync
//まずは、以下のプロパティを宣言します。
@property (nonatomic, strong) CBLReplication *pull;
@property (nonatomic, strong) CBLReplication *push;
//そして、以下のようなメソッドを作ります。
- (void)syncServer{
// sync method
AppDelegate *ap = ApplicationDelegate;
View CoucbaseLite sync Notif
- (void) observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
// push & pull Action
if (object == self.pull || object == self.push) {
// レプリケーションモードを取得
View gist:8143715
//まずはプロパティを宣言
@property (nonatomic, strong) CBLLiveQuery *liveQuery;
//ViewDidLoadに以下を追加します。
AppDelegate *ap = ApplicationDelegate;
self.liveQuery = [[ap.database queryAllDocuments] asLiveQuery];
[self.liveQuery addObserver:self forKeyPath:@"rows" options:0 context:NULL];
You can’t perform that action at this time.