## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6 ## Block 段落 空白行を挟むことで段落となります。 ```
段落1
(空行)
段落2
``` 段落1 段落2 ## Br 改行 改行の前に半角スペース` `を2つ記述します。 ```
hoge
fuga(スペース2つ)
piyo
``` hoge
fuga piyo ## Blockquotes 引用 先頭に`>`を記述します。ネストは`>`を多重に記述します。 ```
> 引用 > 引用
>> 多重引用
``` > 引用 > 引用
>> 多重引用 ## Code コード `` `バッククオート` `` 3つ、あるいはダッシュ`~`3つで囲みます。 ```
print 'hoge'
``` ```
print 'hoge'
``` ### インラインコード `` `バッククオート` `` で単語を囲むとインラインコードになります。 ```
これは `インラインコード`です。
``` これは `インラインコード`です。 ## pre 整形済みテキスト 半角スペース4個もしくはタブで、コードブロックをpre表示できます ``` class Hoge def hoge print 'hoge' end end
``` class Hoge def hoge print 'hoge' end end ## Hr 水平線 アンダースコア`_` 、アスタリスク`*`、ハイフン`-`などを3つ以上連続して記述します。 ```
hoge
***
hoge
___
hoge
---
``` hoge
***
hoge
___
hoge
--- # Lists ## Ul 箇条書きリスト ハイフン`-`、プラス`+`、アスタリスク`*`のいずれかを先頭に記
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Fs = require('fs') | |
const Path = require('path') | |
const Axios = require('axios') | |
async function downloadImage () { | |
const url = 'https://unsplash.com/photos/AaEQmoufHLk/download?force=true' | |
const path = Path.resolve(__dirname, 'images', 'code1.jpg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.14-buster | |
RUN go version | |
ENV GOPATH=/ | |
COPY ./ ./ | |
# install psql | |
RUN apt-get update | |
RUN apt-get -y install postgresql-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB::enableQueryLog(); | |
$val = 1; | |
$results = Model::with(['relation' => function($q) use ($val){ | |
$q->where('col', $val); | |
}])->get(); | |
dd(DB::getQueryLog()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<vue-qrcode :value="json" ref="qr" :options="{ width: 200 }"></vue-qrcode> | |
<q-btn label="Export" @click="exportPDF" /> | |
</template> | |
<script> | |
import Jspdf from "jspdf"; | |
export default { | |
name: "PageIndex", | |
data() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<q-page class="flex flex-center"> | |
<qrcode :value="json" ref="qr" :options="{ width: 200 }"></qrcode> | |
<q-btn label="Export" @click="exportPDF"/> | |
</q-page> | |
</template> | |
<script> | |
import Jspdf from 'jspdf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 'dd.mm.yyyy' to Date | |
* @param {string} dateStr | |
* @returns {Date} | |
*/ | |
const toDate = (dateStr) => { | |
const [day, month, year] = dateStr.split('.').map(el => parseInt(el)) | |
return new Date(year, month - 1, day) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function startJobAt(hh, mm, code) { | |
var interval = 0; | |
var today = new Date(); | |
var todayHH = today.getHours(); | |
var todayMM = today.getMinutes(); | |
if ((todayHH > hh) || (todayHH == hh && todayMM > mm)) { | |
var midnight = new Date(); | |
midnight.setHours(24,0,0,0); | |
interval = midnight.getTime() - today.getTime() + | |
(hh * 60 * 60 * 1000) + (mm * 60 * 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10.15.1-slim | |
COPY ./package.json ./yarn.lock /app/ | |
# Install dependencies for node-gyp | |
# https://github.com/nodejs/node-gyp#on-unix | |
RUN buildDeps='g++ make python' \ | |
&& apt-get update \ | |
&& apt-get install -y --no-install-recommends $buildDeps \ | |
&& cd /app \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Поиск ближайшего значения в массиве | |
* @param array | |
* @param target | |
* @returns {*} | |
*/ | |
const closest = (array, target) => { | |
return array.reduce((prev, curr) => { | |
return (Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev); | |
}) |
NewerOlder