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 angular = require('angular'); | |
require('hogeDirective.css'); | |
require('hogeDirective.html'); | |
class HogeDirective { | |
constructor() { | |
return { | |
restrict: 'AE', |
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
#!/bin/bash | |
# countlogファイルに現在のカウント数を書き出し、スクリプトを呼ぶたびにカウントアップする | |
txt=`cat countlog` | |
echo $txt | |
res=$(( txt + 1 )) | |
# countlogを使用した処理。ここではREST APIのcall | |
curl -X GET "http://hostname/someapi?count=$res" |
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'); | |
// $ node update-version.js build | |
/* | |
$ node update-version.js build | |
update version from 1.6.9 to 1.6.10 | |
$ node update-version.js minor | |
update version from 2.0.0 to 2.1.0 |
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 bottle import route, hook, run, request, HTTPResponse | |
ipac_list = [ "127.0.0.1", "999.999.999.999" ] # safe ip addresses here. | |
@hook('before_request') | |
def before_request(): | |
remote_addr = request.environ.get('REMOTE_ADDR') | |
if remote_addr not in ipac_list: | |
print(request.environ['PATH_INFO'], " -> /error_403") | |
request.environ['PATH_INFO'] = '/error_403' |
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
Show hidden characters
{ | |
"presets": [ | |
[ | |
"env", | |
{ | |
"modules": false | |
} | |
], | |
"es2017" | |
] |
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
[ | |
{ "code": 1, "title": "北海道" }, | |
{ "code": 2, "title": "青森県" }, | |
{ "code": 3, "title": "岩手県" }, | |
{ "code": 4, "title": "宮城県" }, | |
{ "code": 5, "title": "秋田県" }, | |
{ "code": 6, "title": "山形県" }, | |
{ "code": 7, "title": "福島県" }, | |
{ "code": 8, "title": "茨城県" }, | |
{ "code": 9, "title": "栃木県" }, |
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
# install dependencies | |
COPY Pipfile Pipfile.lock ./ | |
# RUN set -x; \ | |
# pipenv install --system --verbose | |
# こうやりたいけど、tensorflow-gpuよりpipenvで入るtensorflowが優先されてしまうのでNG | |
RUN set -x; \ | |
pipenv lock -r > requirements.txt; \ | |
sed -i.bak '/^tensorflow/d' requirements.txt; \ |
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
import sensor | |
import image | |
import video | |
import lcd | |
import KPU as kpu | |
lcd.init() | |
sensor.reset() | |
sensor.set_pixformat(sensor.RGB565) |
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
import network, socket, time, sensor | |
import gc | |
import os | |
import lcd, image | |
from machine import UART | |
from Maix import GPIO | |
from board import board_info | |
from fpioa_manager import fm |
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
#include <M5Atom.h> | |
// M5AtomのGroveコネクタ | |
#define DIR_PIN 32 | |
#define STEP_PIN 26 | |
void setup() { | |
M5.begin(true, false, true); | |
// EasyStepper(A3967, A4988) の制御ピン |
OlderNewer