node.js でパスを取得する方法についてのメモ
$ node ~/hoge/Foo.js/a.js
を実行したときに、
process.argv[1]
から、node コマンドに指定された a.js のパス(~/hoge/Foo.js/a.js
)を取得できます
node.js でパスを取得する方法についてのメモ
$ node ~/hoge/Foo.js/a.js
を実行したときに、
process.argv[1]
から、node コマンドに指定された a.js のパス( ~/hoge/Foo.js/a.js
)を取得できます<!-- index.html --> | |
<html> | |
<head> | |
<title>Qiitaトレンド</title> | |
<meta charset="UTF-8"/> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> | |
<link href="http://nvd3.org/assets/css/nv.d3.css" rel="stylesheet" type="text/css"> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
This CSS stylesheet allows you to preview markdown files in VSCode using GitHub's mardown theme. This CSS was taken directly from the official GitHub Markdown repo. I replaced their top-level .markdown-body
class with the body
tag so it would work in VSCode, and added styling for the html
tag to match GitHub's fixed-width container.
Copy the CSS file to your computer
Copy the github-markdown.css
file below to your computer. You can put it anywhere you want, but I chose to put it in the same folder as my VSCode settings file.
Edit your VSCode settings
If you want to use this theme for all of your projects, then edit your User Settings file. If you just want to use this them
swagger: '2.0' | |
info: | |
title: "Pixiv App API" | |
description: "Unofficial API specification extracted from Pixiv Android App v5.0.17" | |
version: "1.0" | |
host: app-api.pixiv.net | |
schemes: | |
- https |
# -*- coding: utf-8 -*- | |
import datetime | |
import sys | |
try: | |
g, y, m, d = sys.argv | |
except: | |
exit() | |
try: | |
t = datetime.date(int(y), int(m), int(d)) | |
try: |
# -*- coding: utf-8 -*- | |
import tweepy | |
import sqlite3 | |
import os | |
import time | |
if __name__ == "__main__": | |
auth = tweepy.OAuthHandler(CK, CS) | |
auth.set_access_token(AK, AS) | |
api = tweepy.API(auth) | |
path1 = os.path.isfile("followers.db") |
# -*- coding: utf-8 -*- | |
import requests | |
import json | |
import re | |
import sys | |
print u"このプログラムは横浜市資源循環局のイーオくんとお話できるプログラムだよ" | |
print u"終了したいときは[Ctrl+C]を押すか[/exit]と送ってね" | |
print u"---" * 20 | |
print u"イーオだよ。こんにちは。" | |
print u"ゴミの名前を教えてくれたら、捨て方を案内するよ。粗大ごみの手数料を知りたい場合は、「自転車の手数料」のように話しかけてね。" |