一次情報に近い二次情報の情報源をまとめたもの。
ここでの一次情報はコミットとかコードのこと。
| # frozen_string_literal: true | |
| class ApplicationRecord < ActiveRecord::Base | |
| self.abstract_class = true | |
| # List all model classes | |
| def self.models | |
| @models ||= begin | |
| models = [] | |
| Rails.root.join('app', 'models').glob('**/*.rb') do |path| |
| // To parse this data: | |
| // | |
| // import { Convert, Coordinate } from "./file"; | |
| // | |
| // const coordinate = Convert.toCoordinate(json); | |
| // | |
| // These functions will throw an error if the JSON doesn't | |
| // match the expected interface, even if the JSON is valid. | |
| /** |
パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。
ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。
| /* compile: gcc -o mpywd -lfcgi mpywd.c */ | |
| #include <stdio.h> | |
| #include <fcgi_config.h> | |
| #include <fcgi_stdio.h> | |
| int main(void) { | |
| while (FCGI_Accept() >= 0) { | |
| printf("Content-Type: text/html\n"); | |
| printf("Status: 302 Found\n"); | |
| printf("Location: https://twitter.com/mpyw\n"); |
| python3<<<"import neovim; neovim.attach('socket', path='$NVIM_LISTEN_ADDRESS').input('<C-\\><C-n>')" |
以下転載:
| #!/usr/bin/env python | |
| """Edit a file in the host nvim instance.""" | |
| from __future__ import print_function | |
| import os | |
| import sys | |
| from neovim import attach | |
| args = sys.argv[1:] | |
| if not args: |
まっぴーさんが発言した(に向けて発言された)、迷セリフまとめです。
URL: https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q13149033688
汎用性: 高い
その他: ありえないことはありえない。。。
