このメモは、私(@ymmt2005)が長年にわたってソフトウェアプロダクト開発に関わってきて 2022年現在こうしたほうが良いと考えているベストプラクティスです。
科学的な分析等に基づくわけではない経験則であるため、今後も随時見直すことがありますし、 ここに書いてあることが常に正しいわけでもあらゆるソフトウェア開発に適するわけでもありません。
しかしながら、実務経験が豊富で、モダンな技術スタックに明るいエンジニアの経験則は一定の 役に立つのではないかと考えて記します。
| [#assign black_list = ["class", "request", "getreader", "getinputstream", "writer"] /] | |
| [#macro dump key data] | |
| [#if data?is_enumerable] | |
| enumerable:<b>${key}</b> | |
| [@printList data,[] /] | |
| [#elseif data?is_hash_ex] | |
| hash_ex:<b>${key}</b> | |
| [@printHashEx data,[] /] | |
| [#else] |
If you are use Unix/Linux create a bash script with a loop. In this case I want to backup the extensions list and install again:
First create a list of the extensions:
$ code --list-extensions > extensions.txtCreate a bash script for example with the name vscode-extension-install.sh and input the following code:
| # Use envFrom to load Secrets and ConfigMaps into environment variables | |
| apiVersion: apps/v1beta2 | |
| kind: Deployment | |
| metadata: | |
| name: mans-not-hot | |
| labels: | |
| app: mans-not-hot | |
| spec: | |
| replicas: 1 |
| <#if contents.getSiblings()?has_content> | |
| <#assign VOID = freeMarkerPortletPreferences.setValue("view", "carouselContentView") /> | |
| <#-- | |
| * Using Bootstrap 3 carousel HTML markup | |
| * ${.vars["reserved-article-id"].data} is the way you fetch this information in Freemarker. In Velocity it is just ($reserved-article-id.data) | |
| --> | |
| <section class="main-carousel-wrapper"> | |
| <div class="carousel slide" data-ride="carousel" id='main-carousel-${.vars["reserved-article-id"].data}'> |
This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.
import 'firebase';| """os.walk() variation with Google Drive API v3.""" | |
| from collections.abc import Iterator, Sequence | |
| import os | |
| import pathlib | |
| from typing import TypedDict | |
| # $ pip install google-api-python-client google-auth-oauthlib | |
| from apiclient import discovery | |
| from google.oauth2 import credentials |
| public static Observable<Response> getData() { | |
| StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | |
| StrictMode.setThreadPolicy(policy); | |
| final OkHttpClient client = new OkHttpClient(); | |
| final Request request = new Request.Builder() | |
| .url("https://github.com/ar-android/panfic/raw/master/Panfic/gen/com/ocit/data.json") | |
| .get() | |
| .addHeader("cache-control", "no-cache") |
| <#if request.lifecycle == "RENDER_PHASE"> | |
| <#assign journal_content_util = staticUtil["com.liferay.portlet.journalcontent.util.JournalContentUtil"] /> | |
| <div class="lego-article ${article_class.data}" id="article-${.vars['reserved-article-id'].data}"> | |
| <#list section.siblings as cur_section> | |
| <section class="block-container lego-section section-${cur_section_index + 1} ${cur_section.section_class.data}" ${cur_section.data}> | |
| <#list cur_section.block.siblings as cur_block> | |
| <div class="block block-${cur_block_index + 1} content-column lego-block w${cur_block.width.data} ${cur_block.block_class.data}" ${cur_block.data}> | |
| <#list cur_block.element.siblings as cur_element> | |
| <#assign cur_element_tag = cur_element.tag.data> |