Skip to content

Instantly share code, notes, and snippets.

//
// ViewController.swift
// wifitest
//
// Created by 木戸 康平 on 2021/12/08.
//
import UIKit
import NetworkExtension
@9wick
9wick / GasAdapter.ts
Created May 3, 2020 10:15
GasDataFetchUtils
import HttpMethod = GoogleAppsScript.URL_Fetch.HttpMethod;
import { URLSearchParams } from "url";
let gasAdapterInstance = null;
type GasEnv = "gas" | "local";
type FetchMethod = "GET" | "POST";
export class GasAdapter {
static getInstance(): GasAdapter {
m5.onconnect = async () => {
await m5.setupIMUWait("MPU6886");
let timeA = new Date();
while (1) {
let data = await m5.imu.getAllDataWait();
let timeB = new Date();
var msDiff = timeB.getTime() - timeA.getTime();
timeA = timeB;
//モータドライバを用いて鉄道模型を制御するためのライブラリ
//十三車両製作所
//グローバル変数
var pwmNo1;
var pwmNo2;
var pwmNo3;
var pwmNo4;
var pwmNo5;
var pwmNo6;
@9wick
9wick / opencv.js
Last active August 16, 2018 09:00
This file has been truncated, but you can view the full file.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(function () {
return (root.cv = factory());
});
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
@9wick
9wick / file0.txt
Created May 11, 2018 12:24
javascriptの構文解析をしてみる ref: https://qiita.com/wicket/items/816c8703d23945462dfd
/**
* comment
*/
function printTips() {
var myHeading = document.querySelector('h1');
myHeading.textContent = 'Hello world!';
}
@9wick
9wick / file0.txt
Created May 4, 2018 06:26
codemirrorのlint error/warningをモバイルでも表示する ref: https://qiita.com/wicket/items/709c9be0e73b868d85c2
CodeMirror.on(cm.display.scroller, "touchend", function (e) {
let touch = cm.display.activeTouch;
let date = new Date;
if (touch && touch.left != null &&
!touch.moved && date - touch.start < 300) {
//エディタの何処かをsingle tapした
if (!touch.prev) {
@9wick
9wick / file0.txt
Created February 7, 2018 02:54
Node.jsで単体testを書く際に,モジュールをstubに置き換える ref: https://qiita.com/wicket/items/af9a5d74608bedf97a85
var moduleStubs = {};
var originalJsLoader = require.extensions['.js'];
var stubOnModule = function(module) {
var path = require.resolve(module);
var stub = sinon.stub();
moduleStubs[path] = stub;
delete require.cache[path];
return stub;
@9wick
9wick / file0.txt
Last active February 5, 2018 04:37
macOSのアップデートをした後にsshキーが無いと言われた ref: https://qiita.com/wicket/items/da88cf2914e4f72842b3
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/master
Pushing to git@github.com:9wick/xxxx.git
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above
@9wick
9wick / file0.txt
Created January 29, 2018 07:49
Firebase storageでのグループ認証 ref: https://qiita.com/wicket/items/85115c4a6045f4d5fecd
{
users:{
userA : {
groups : {
groupA : true
groupB : true
}
},
userB : {
groups : {