You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Lorca+SvelteKitでやってみる! https://github.com/zserge/lorca https://github.com/sveltejs/kit あらかじめ必要なもの go(version 1.17.2以降) nodejs(16.9.0以降),npm(7.21.1以降) Chrome/Chromium/Edgeのいずれか プロジェクトの開始 mkdir sample-gui cd sample-gui go mod init sample-gui npm init svelte@next frontend // Choice "Svelte app template" is "Skelton Project". // Choice "Use TypeScript" is No. // Choice "ESLint" is No. // Choice "Prett
アプリケーションが発行するSQLにコメントが埋め込めると便利です。例えば、 /* path/to/logic.go:334 */ SELECT ... のようにSQLに発行元の情報をコメントとして埋め込んでからExecすれば、DB側のログ(general log等)にも記録されるため、SREやDREサイドからも、負荷の高いSQLがアプリケーションのどこから発行されているかが分かりやすくなります。 Goには github.com/shogo82148/go-sql-proxy という、SQL実行をトレースし、フック処理を差し込める便利なライブラリがありますが、今回それにpull requestを送って、SQL実行前にクエリの書き換えができるようにしました。 https://github.com/shogo82148/go-sql-proxy/pull/61 https://github.co
jpp というJSON Pretty-Printer を作りました。 github.com このコマンドはJSONを要素ごとに1つ1つ改行するのではなく、画面内(もしくは指定した幅)に収まる限りできるだけ改行を挟まずに要素を表示します。 そのため、例えばarrayの中身に大量の要素が入っているものや、objectの中身にfieldが大量にあるようなJSONを表示する際、改行をできる限り抑えて表示することによりJSONを見通しよく眺めることができます。 背景 JSONを整形して表示することができるCLIツールとして、jq、jsonppや、 python -m json.tool などがありますが(jq はpretty-printのためのツールではないが僕は普段jsonの整形のためによくjqを使っていた)、 これらの既存のJSON pretty-printerを用いて、先に述べたような要素数の
« Software Design 2018年7月号「Vim 絶対主義」の執筆に参加しました。 | Main | ボタンを押したら golang の if err... を自動入力 » tensorflow といえば Python と思っておられる方も多いのではないでしょうか。間違いではないのですが、これは初期に作られた Python 向けのバインディングに研究者達が多く食いついた結果に過ぎないと思っています。実際 tensorflow は現在 C言語、C++、Python、Java、Go から利用する事ができ、最近では JavaScript にも移植されています。筆者自身も Go で tensorflow を使ったシステムを構築し、運用保守しています。問題も発生せず機嫌良く動いています。学習の利用部分は GPU のパフォーマンスに依存しますが、それ以外の部分については各言語の実装に依存し
データベースマイグレーションツールでフレームワーク非依存のもので有名所といえばflywayだが、Java製のツールであるためJVMを入れておく必要がある。JVMを入れるというのが意外とハードルで、稼働中の環境に入れる場合は影響範囲が怖かったり、CIのたびに容量が小さくないJVMを入れるのはちょっと・・・というケースもある。 そんなときにオススメしたいのがGo製のマイグレーションツールmattes/migrateだ。flywayと同じくCLIツールだが、JVMのようなランタイムは不要だ。ビルド済みのバイナリがGitHubで提供されていて、インストールはcurlやwgetですぐにできる。容量も7.1Mと小さい。MySQLやPostgreSQLなど主要なデータベースに対応している。Go製であるが、マイグレーションファイルは素のSQLで書くから、ユーザにはGo言語の知識は必要ない。 mattes/
eval: それぞれのモジュールはevalとして実行され//@ sourceURLが付けられます source-map: SourceMapを完全に別ファイルとして生成します。output.sourceMapFilenameで設定が可能です hidden-source-map: source-mapと同様SourceMapを別ファイルとして生成しますがバンドルに参照コメントを含みません inline-source-map: SourceMapはDataUrlとしてバンドルされます eval-source-map: それぞれのモジュールはevalとして実行され、SourceMapはDataUrlとしてevalに追加されます cheap-source-map: SourceMapは列を無視して生成されます。loaderで読み込まれたSourceMapは無視されます。 cheap-module-
http://commit-m.minamijoyo.com/:titele という有名OSSのコミットメッセージを検索できるサービスがあって、英語のコミットメッセージを書くときに「あれ? これどういう風に書けばいいんダー」ってときに例文を検索できて捗る。 commit-m.minamijoyo.com が、自分の場合はコミットメッセージ書くときはvim とか git commit -m とかからなのでCLIで検索できたらより捗るかと思ってGolangで書いた。 APIとかは無いようなのでクロールしてる。 GoQuery 使えばこの手のクローラーが一瞬でかけるのでよさがある。 github.com go get github.com/yuroyoro/gommit-m で入れた後に gommit-m keyword [page] で検索できる。
Goは思いついたときにサクッとつくって即公開できたら最高だと思う。 https://gist.github.com/ を使えばブラウザで簡単にGoを書いて公開できる。 要点 GoはGitレポジトリ上に存在するパッケージを指定できる GistはGitレポジトリとしてのインターフェースを備えている Gistには複数のファイルを置ける そもそもGoにはGemfileすら要らなかった やり方 package nurupo import ( "errors" "strings" ) func Nurupo(message string) error { if strings.Contains(message, "ぬるぽ") { return errors.New("ガッ") } return nil }
Go言語のDependency/Vendoringは長く批判の的になってきた(cf. “0x74696d | go get considered harmful”, HN).Go1.5からは実験的にVendoringの機能が入り,サードパーティからはDave Chaney氏を中心としてgbというプロジェクベースのビルドツールが登場している.なぜこれらのリリースやツールが登場したのか?それらはどのように問題を解決しようとしているのか?をつらつらと書いてみる. Dependencyの問題 最初にGo言語におけるDependecy(依存解決)の問題についてまとめる.Go言語のDependencyで問題なのはビルドの再現性が保証できないこと.この原因はimport文にある. Go言語で外部パッケージを利用したいときはimport文を使ってソースコード内にそれを記述する.このimport文は2通りの
« lingr で stackverflow を検索出来る bot を golang で書いた。 | Main | Vim scriptで「ソフトウェアエンジニアならば1時間以内に解けなければいけない5つの問題」を解いてみた » willnet/gimei - GitHub gimei は、日本人の名前や、日本の住所をランダムに返すライブラリです。テストの時などに使います。似たようなライブラリにfakerがあります。fakerはとても優れたライブラリで、多言語対応もしていますが、ふりがな(フリガナ)は流石に対応していません。gimei ふりがな(及びフリガナ)に対応しています。 https://github.com/willnet/gimei オリジナルは ruby gems です。 mattn/go-gimei - GitHub golang port of gimei https://
背景 Zsh の醍醐味のひとつが補完機能であるのは言わずもがなですね。 この補完について、基本的なコマンドや有名プロジェクトのコマンドなどの多くは提供されているのですが、自作コマンドもちろんのこと、マイナーなコマンドは提供されていなかったりします。 その場合、ユーザが Zsh スクリプトの記法で補完ファイルを記述しなければなりません。これが結構骨の折れる作業で、Zsh が提供する補完インターフェースは高機能ゆえに複雑怪奇で、並みのユーザはおろか熟練のシェルスクリプターでも投げ出したくなる様です。 特に自作コマンドの場合、コマンドの作成で疲弊して、マニュアルやドキュメンテーションの作成でも疲弊しているところにこの作業となると、まず補完は諦めがちです。 b4b4r07/zgencomp · GitHub DEMO: そこでこのツールを使います。コマンドのUIについて簡単な JSON ファイルを
合計5枚の写真が、3秒ごとに切り替わります。 記事に戻る ※このページで使用している「Simple jQuery Slideshow Script」は、Jon Raasch氏によって作成されたスクリプトです。
Windows ユーザのごく一部には、コマンドプロンプトが無いと生きられない民族がいます。そしてその民族の一部には cygwin や msys bash 等といった、サードパーティなシェル(powershell?何それ聞こえなーい)を使いたがらない種族もいます。 私もその種族なのですが、今日はそういった世界中のWindowsエンジニアの中でも数パーセントしかいないであろう人達にとって便利なTipsを紹介したいと思います。(オマケでbash連携もあるよ) lestrrat/peco - GitHub https://github.com/lestrrat/peco 以前、私も同じようなツールとして gof というのを作りましたが、peco はこれをもっと簡素に、もっとカスタマイザブルにした物になります。 一見、UNIX でしか動作しなさそうに見えますが、gof ど同様に Windows でも
https://github.com/rosylilly/pprocess ~/.pprocess.json に { "token": "application token", "user": "user token" } てな具合で設定を保存して、 $ go get github.com/rosylilly/pprocess $ pprocess -m "通知" とか送ると、 Pushover 経由で通知が飛ぶ。設定は device とか sound も設定できるけど、僕の需要にないので多分動かない。 何はともあれこれのお陰で packer で AMI を作ってる間に洗い物してても終わったら通知が iPhone に来るようになった。なんでもかんでも無差別につながっていくの最高だと思う。
2014年でも html を解析してゴニョゴニョするなんて要件はまだまだある訳で、そんな時に便利なのが pup というコマンドです。 EricChiang/pup - GitHub README.md pup pup is a command line tool for processing HTML. It reads from stdin, prints to stdout,... https://github.com/EricChiang/pup 通常、こういったツールは perl や ruby、python 等で提供されランタイムがインストールされていない環境で動かすのはちょっとした手間が発生していました。しかし pup ならば golang で出来ているのでバイナリ1つあれば動かせます。 使い方は、例えばこのサイトのパーマリンクのHTMLを得たいならば curl -s http:
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く