Skip to content

Instantly share code, notes, and snippets.

View tom-tan's full-sized avatar
🌴
(:3 」∠ )_

Tomoya Tanjo tom-tan

🌴
(:3 」∠ )_
View GitHub Profile
@tom-tan
tom-tan / use_njs.d
Last active August 4, 2022 07:56
njs をD言語から使いたい
#include <njs_main.h>
/// 実際には use_njs.dpp として使う
// workaround
//
alias u_char = ubyte;
int main(string[] args)
{
import std : toStringz;

rootless podman in rootless podman なら動く(Ubuntu 22.04)。 ただし、ホストに書き込むには podman unshare を使ってコンテナ内のユーザー用にパーミッションを変更する必要がある。

$ echo $UID:$GID
1000:1000
$ podman unshare chown 1000:1000 -R $PWD
$ podman run -it --rm --user podman --device /dev/fuse -v $PWD:/workdir:Z -w /workdir quay.io/podman/stable bash
[podman@328a1796e173 workdir]$ podman run -it --rm -v $PWD:/workdir:Z -w /workdir alpine sh
...
@tom-tan
tom-tan / 通知方法案.md
Last active April 30, 2020 12:15
Colaboratory での変更を通知する方法(案)

前提

  • 以下から引用: https://slack.com/intl/ja-jp/help/articles/205875058-Slack-%E3%81%A7-Google-%E3%83%89%E3%83%A9%E3%82%A4%E3%83%96%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B
    • Slack に通知が届く場合
      • Google ドライブのファイルへのアクセスを誰かがリクエストした時
      • 誰かが Google ドライブのファイルをあなたと共有した時
      • 誰かがあなたのファイルにコメントを付けた時 (提案やタスクの割り当てなども含む)
      • Google ドライブからストレージに関するアラートが送信された時
  • すなわち、他の人のファイルに更新やコメントが有った場合に通知する方法はない
    • そのため Slack の通知機能を使おうとすると、通知先のユーザーのファイルにコメントを加えて貰う必要がある
@tom-tan
tom-tan / gist:b5669b6dc1f1b897a39dd4eedecfbb9b
Last active January 19, 2021 14:27
podman を Alpine 内で動かそうとしたメモ
@tom-tan
tom-tan / example.cwl
Created April 9, 2018 06:18
入力パラメータを出力ファイル名に反映させるサンプル
class: CommandLineTool
cwlVersion: v1.0
baseCommand:
- echo
inputs:
inputfile:
type: File
inputBinding: {}
method:
type: string
@tom-tan
tom-tan / cwl-inserter.el
Last active November 10, 2017 08:32
Docker image 名や CWL ファイル名を挿入する関数群
(defun insert-docker-image (image)
(interactive
(let* ((val (completing-read
"docker image: "
(split-string
(shell-command-to-string
"docker images --format \"{{.Repository}}:{{.Tag}}\""))
'stringp)))
(list val)))
(insert image))
@tom-tan
tom-tan / exclusive-job.yml
Created October 30, 2017 08:00
CWL での排他オプションの記述サンプル
args:
# version: true
# help: true
files:
- class: File
location: exclusive.cwl
- class: File
location: exclusive-job.yml
@tom-tan
tom-tan / cwl-preview.el
Last active October 25, 2017 06:07
cwl のワークフローを可視化したい
;; requirements: cwltool, graphviz, open コマンド
(defvar cwl-workflow-figure nil)
(make-variable-buffer-local 'cwl-workflow-figure)
(defun cwl-generate-figure (&optional buffer)
(interactive)
(unless flycheck-current-errors
(let* ((tmpdir "/tmp/")
(cwl (buffer-file-name buffer))
--- configure 2014-10-27 13:56:10.000000000 +0900
+++ ../Bridger_r2014-12-01/configure 2017-05-18 18:22:22.000000000 +0900
@@ -15813,8 +15813,8 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <boost/version.hpp>
boost-lib-version = BOOST_LIB_VERSION
_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- tr -d '\r' |
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed '/^#/d' | sed -e 's/^[ ]+//' |
+ tr -d '\n' |
// Written in the D programming language.
/**
This module includes helper functions to anotate unsafe operations as trusted operations.
See: http://dlang.org/function.html
Here is the list of unsafe operations described in the spec.
- No casting from a pointer type to any type other than void*.
- No casting from any non-pointer type to a pointer type.
- No modification of pointer values.