コンパイラかく語りき

import { Fun } from 'programming'

【Cocoapods】 pod setupにて error: RPC failed; curl 56 SSLRead() return error -36| 2.27 MiB/s

発端 以下の記事に従っていた所、エラーが。 【Swift】CocoaPods導入手順 - Qiita $ pod setup Setting up CocoaPods master repo $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress Cloning into 'master'... remote: Counti…

jQuery脱却の第一歩 doc-readyをつかってみる

クライアントのJSを書くとき、DOMのロードを待つ必要がある時があります。そんなとき、jQueryなら、以下のように書きますね。 $(document).ready(function() { // your code comes here... }) ただ、JSの小さなモジュールを作るためにいちいちjQueryを使うの…

rethinkdbdashを試してみる

RethinkDBのNodeドライバと言えば、公式のドライバがあります。もちろんこれは不満なく使うことができるのですが、どうやらrethinkdbdashという別のドライバもあるようです。 この記事ではrethinkdbdashの特徴や機能について、READMEを訳す形でメモしていき…

ExpressとRethinkDBで作るRESTfulなWebAPI

ExpressとRethinkDBで作るRESTfulなWebAPIです。 RethinkDB公式のこちらを参考にしました。 ひとまず、Expressでルーティングを定義して、RethinkDB上のデータへのCRUD処理ができるところまで。 前提条件 RethinkDBをインストールしておく。 Express起動前に…

Promiseチェーンの中で条件を満たすまで同じ処理を繰り返す(リトライ処理)

Promiseチェーンの中で、特定の条件を満たすまで同じ処理を繰り返したい場合があります。 例: データロード処理 そんな場合のコードサンプルです。 コード こちら。 const retryPromise = (func, delay) => { const retry = (resolve, reject) => func() .th…

table-layout: fixed; せずに text-overflow: ellipsis; する

長過ぎる文字列に対して、文末に「…」をつけて省略して表示したい時があります。 これをHTMLのtable要素で実現する方法について書きます。 固定幅テーブル まず、行が固定幅で良いのなら以下のように書けます。 table { table-layout: fixed; } td { white-s…

curlに対して、Express上のGraphQLサーバが Must provide query string. を返す

問題 Express上のGraphQLサーバへと、curlでqueryを発行した。 $ curl -XPOST -H "Content-Type:application/graphql" \ 'http://localhost:5000/api/graphql' \ -d 'query Query { user(_id: 3) { name, mail } }' すると、以下のようなレスポンスが。 { "e…

webpacker2.0に上げたら、Herokuへのデプロイが失敗する対処(Configuration config/webpacker.yml file not found. Make sure webpacker:install is run successfully before running dependent tasks)

問題 Herokuへのデプロイが失敗した。 webpacker gemを2.0に上げたのが原因っぽい(元々は1.2でした)。 こちらがエラーログ。 Configuration config/webpacker.yml file not found. Make sure webpacker:install is run successfully before running depend…

The git source `hoge` uses the `git` protocol, which transmits data without encryption...の対処法

問題 Gemfile内でgemに対して、:github プロパティを使っていた所、以下のようなエラーが。 The git source `hoge` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`…

ReqlDriverError: Could not connect to localhost:28015. → RethinkDB自体が起動していませんでした

RethinkDBとRethinkDBのnodeドライバに関して、ちょっとハマったのでメモ。 問題 ローカルのコンソールからRethinkDBのドライバを起動しようとする。 // server.js r = require('rethinkdb') r.connect({host: 'localhost', port: 28015}... $ node server.j…