Rodhos Soft

備忘録を兼ねた技術的なメモです。Rofhos SoftではiOSアプリ開発を中心としてAndroid, Webサービス等の開発を承っております。まずはご相談下さい。

VueABCその2 基本

Vue

テンプレート {{ }} <div>hoge world,{{ name }}?</div> でそのテンプレートのnameのdataをみている。{{ }}は口髭(Mustache) クリック v-on:click <button v-on:click="pushCrick">push</button> これでテンプレートのpushCrockメソッドが呼ばれる。 テーブルリスト v-for <table> <tr v-for="item in myTableData" v-bind:key="item"> <td><img src="" /></td> <td> {{ item.title }}…</td></tr></table>

Vue.JS ABC勉強ノート

Vue

基本 <template> </template> <script> </script> <style> </style> プラグインを各種使う Vue.config.productionTip = false new Vue({ router, vuetify, render: h => h(App) }).$mount('#app') アプリのマウント new Vue({ el: '#app` // エレメントのid指定 }) this.$elでマウントしたタグが見れる。 スクリプ…

Basic認証周り

didReceiveAuthenticationChallenge でchallenge.protectionSpace.authenticationMethodがNSURLAuthenticationMethodHTTPBasicなものが飛んでくる。 completionHandlerにNSURLCredentialでinitWithUserでユーザ名とパスワードを入れてNSURLCredentialPersist…

adhoc周り

Rebuild from Bit Codeやるとipaの中身が変わってくる。 今回はやっていないのが正解だった。 あと プロファイルは証明書(certification)とアプリとdeviceを紐付けるが、今回キーチェーン内にその証明書の秘密鍵がなかった。しかも証明書が同盟のものが複数…

ファイル操作

試してみた。 import { utilFunc } from './util'; import * as fs from 'fs'; import * as path from 'path'; import * as readline from 'readline' console.log("Hello, typescript!"); console.log(utilFunc("test")); console.log(process.cwd()); cons…

カッコの閉じ忘れ

$("[data-hoge data-btn-hoge").show(); と最後の]を入れ忘れた。 ([^\]])("\).show) を $1]$2 で変換した。

iBeaconが探知されない。

iBeaconが探知されない理由がわかった。"常に"を許可してもらわないとだめなようだ。マニュアル的にはiPhoneの設定画面から変えてもらうしかなくなる。逆にそこで常に許可をしてもらえば動く。 このあたりiOS13以降ではまた違うかも。

図の描き方

Tikzで三角形を描いてみた。 \usepackage{tikz} \usetikzlibrary{intersections, calc, arrows} をプリアンブルで宣言しておいて、以下にようにnewcommandで定義して使う。計算はcalcによって行われている。 \newcommand{\myTriangle}[1]{ \coordinate (myA)…

ジェネリクスな配列による変数定義

export const eventIdList = <const>["HogeEV", "PoiEV"]; export type EventId = typeof eventIdList[number];</const>

基礎的なこと

ひとまず座学したことをまとめてみた。 Dockerはコンテナ 仮想化OSを使用しない分軽く手軽。 基本 Dockerファイル(設定ファイル)を作って、ビルドしてイメージを作る。イメージを実行してコンテナを起動する。 Dcokerイメージ すでにDocker Hubに色々用意さ…

大文字と小文字の変換

選択しておいてコマンドパレットからtransform to UpperCase等を呼ぶ。

ショートカット Mac 矩形選択

Sift+Cmd+Altを押しながら上下作用にカーソルを動かしていく。

デフォルトのアイコン等

iOS Developerから取得できる。モック作成に使える。 https://developer.apple.com/design/resources/

スニペット登録

設定画面にスニペット登録項目があるのでクリックしJSONを編集する。 "hoge": { "prefix": "hoge", "body": [ "ABCD", "DDDDDDDDDDD", ], "description": "for hoge" } 登録するとprefixまで書いてからコード補完が効く。macならalt+esc Snippets in Visual …

webpackの外から呼ぶ。

windowに突っ込む。。 window.onHoge

ショートカット Mac コード補完

alt + escでできる。 editor.action.triggerSuggest

ある文字ではじまらない

たとえば-やで始まらない行をしていしたい。 ^(?!(-|\+)).+$

現在の場所を変数に入れる

pwd export HOGE=`pwd` echo $HOGE

ファイル移動

特定のファイルをディレクトリに入れる。 find . -name "*.html.ts" -type f|xargs -L 1 -I {} mv {} tmp

WkWebViewでのJSのやりとりでの失敗

非常に情けない失敗をしたので反省のため書いておく。WKWebViewでContentControllerでjsからswiftにメッセージを送る際、window.webkit.messageHanddlerに登録したハンドラがなくて落ちるを繰り返していた。 どこを調べても問題ない。→ 調査した結果、登録し…

iOS10.1以下ではurl.searchparamがつかえない

js

こんな便利メソッドを用意してみた。 /// iOS10.1以下のurl.searchParamsが使えないバージョン対応 private get params_old_version(): any { let params = this.url.search.substring(1).split("&"); let args = {} as any; for (let i = 0; i < params.len…

ショートカット

Visual Studio Code キーボード ショートカット - Qiitamacで ctrl+-で戻る それにシフトを足すと進む

サブモジュールが空

git

次を参考にした。 [Git]あるはずのsubmoduleが空ディレクトリになってる場合の対処法 · DQNEO起業日記 Git submodule の基礎 - Qiitagit submodule init git submodule update していなかった。なぜsourcetreeではできないのかはちょっとわからない‥。

使い方メモ

git

ログをみる git log ログの変更内容をみる git -p ログの変更内容を一つ前のものだけみる git -p -1 数値を増やすと何個前までみるか指定できる。

csvの加工

ちょっと進化した。 import csv import pprint import sys import os import glob # usage # python3 transErrorMessage.py def replaceRet(txt: str): return txt.replace("\n", "\\n") def wrapDQ(txt): return "\""+txt+"\"" surfix = "_SEMISELF" def ma…

csvの加工

import csv import pprint import sys # usage # python3 transErrorMessage.py a.csv def replaceRet(txt:str): return txt.replace("\n","\\n") def wrapDQ(txt): return "\""+txt+"\"" surfix = "_hoge" filename = sys.argv[1] with open("./"+filename)…

express-generator-typescript

```cterm npm install express-generator-typescript ```作成 ```cterm npx express-generator-typescript "hello-app" ```hello-appの中に入って実行 ```cterm cd hello-app npm run start-dev ```

hello express

expressをinstallしておく npm install express typeも npm install @types/express import express from "express"; var app = express(); app.get("/", (req, res) => { return res.send("Hello World!"); }); app.listen(3001, () => { console.log("app …

hello node

nodeのtypeを入れておく。 npm install @types/node import * as http from "http" let server:http.Server = http.createServer((req:http.IncomingMessage, res:http.ServerResponse) => { res.writeHead(200, {'Content-Type':'text/plain'}); res.write(…

abc

バージョン確認 node -v v10.16.0 npm -v 6.9.0 typescriptのコンフィグファイル作成 tsc --init npm開始 npm init typescript実験用にhello.ts作成 console.log("hello") トランスパイル tsc 試しに実行してみる。 node hello.js jsの吐き出し先をdistフォ…