Skip to content

Instantly share code, notes, and snippets.

@rxon
rxon / settings.json
Created July 18, 2021 05:36
vscode setting
{
"editor.accessibilitySupport": "off",
"latex-workshop.view.pdf.viewer": "tab",
"editor.wordWrap": "on",
"workbench.colorTheme": "Monokai",
"editor.fontSize": 14,
"files.exclude": {
"**/*.aux": true,
"**/*.log": true
},
function getBase64() {
return new Promise(function(resolve, reject) {
axios
.get(url, {
responseType: 'arraybuffer'
})
.then(response =>
resolve(new Buffer(response.data, 'binary').toString('base64'))
);
});
function isCorrectSchema(req, res, next) {
const ajv = new require('ajv')();
const valid = ajv.validate(schema, req.body);
if (!valid) {
res.status(400).send('Bad Request: ${ajv.errors}');
}
return next();
}
const schema = {
properties: {
smaller: {
type: 'number',
},
larger: {
type: 'number',
},
},
};
const mongoose = require('mongoose');
const UserSchema = new mongoose.Schema({
userid: {
type: String,
required: true,
},
password: {
type: String,
requird: true,
},
@rxon
rxon / Dockerfile
Last active March 22, 2017 09:06
`npm i && docker-compose up` で mongodb + node on docker-compose on alpine 😎
FROM mhart/alpine-node:7.7.4
ENV HOME=/home/i
ENV APP=starter-app
RUN adduser -D -s /bin/false i
COPY package.json $HOME/$APP/
RUN chown -R i:i $HOME/*
@rxon
rxon / .curlrc
Created February 26, 2017 04:33
#
# _
# ___ _ _ _ __| |
# / __| | | | '__| |
# | (__| |_| | | | |
# \___|\__,_|_| |_|
#
# Enable redirect
-L
@rxon
rxon / maaya.json
Last active February 21, 2017 12:19
まあやお姉さんの今日もがんばれ♥.json
[{
"link": "http://www.tv-tokyo.co.jp/pirameki/gallery/maya/216.html",
"title": "その108♥まあやお姉さんの衣装が大好きな君(横からver.)07.03"
}, {
"link": "http://www.tv-tokyo.co.jp/pirameki/gallery/maya/215.html",
"title": "その108♥まあやお姉さんの衣装が大好きな君(前からver.)07.03"
}, {
"link": "http://www.tv-tokyo.co.jp/pirameki/gallery/maya/214.html",
"title": "その107♥【お便り】変身ポーズ&決めゼリフ!(横からver.)06.27"
}, {
@rxon
rxon / .textlintrc
Created February 11, 2017 04:43
技術文書用textlint設定
rules:
# headerの階層チェック
incremental-headers: true
# 冗長な表現を禁止
ja-no-redundant-expression: true
# リンクが有効か確認 
no-dead-link: true
# JTF日本語標準スタイルガイド
preset-jtf-style: true
# tech word checking for web engineer
@rxon
rxon / node-update.sh
Last active September 17, 2017 13:33
nodebrewでnodeをupdateするsh
#!/usr/bin/env sh
# To update node and npm with nodebrew.
# Run this file with `sudo`.
# Be sure to installed npm
echo "Type latest node version : "
read NODE_VAR
echo Installing node $NODE_VAR