Set timeout to process runs.
Just install coreutils, and use timeout command.
coreutils をインストールして、 gtimeout (Mac) を使用する
| #!/bin/sh | |
| WORK_DIR="/where/to/work/directory" | |
| cd $WORK_DIR || exit # In crontab, it may needs moving into work directory from default directory (home directory) | |
| LS_FILES="$(ls -l file*)" # Wants notify this result | |
| notifyToSlack() { | |
| # In crontab, make sure to the curl command (or other commands) is full path. | |
| /usr/bin/curl -X POST -H 'Content-type: application/json' \ |
| <?php | |
| echo realpath(dirname(__DIR__ . '/../')) . '/foo.php'; | |
| echo "\n"; |
| require 'open-uri' | |
| require 'json' | |
| require 'pp' | |
| user_name = 'gouf' | |
| uri = URI.parse("https://www.codeschool.com/users/#{user_name}.json") | |
| pp json = JSON.parse(uri.open.read) | |
| =begin | |
| pp completed_course_links = |
| require 'mechanize' | |
| module MechanizeScraper | |
| class NicoVideo | |
| TOP_PAGE = 'http://www.nicovideo.jp/'.freeze | |
| LOGIN_PAGE = 'https://account.nicovideo.jp/login'.freeze | |
| MY_PAGE = 'http://www.nicovideo.jp/my/top'.freeze | |
| def initialize(email_or_tel, password) | |
| @mechanize = Mechanize.new |
| 'use strict'; | |
| var app = new Vue({ | |
| el: '#app', | |
| data: { | |
| ESTABLISHMENT_YEAR: 1882, | |
| inputYear: null, | |
| MESSAGE: 'ここに創立経過年数が表示されます' | |
| }, | |
| computed: { |
| require 'aws-sdk' | |
| # Please set your own key id | |
| # Ref: https://console.aws.amazon.com/iam/home?region=ap-northeast-1#/encryptionKeys/ap-northeast-1 | |
| key_id = 'arn:aws:kms:ap-northeast-1:000000000000:key/00000000-0000-0000-0000-000000000000' # note: keep secret key_id, export to environment variable | |
| kms = Aws::KMS::Client.new( | |
| region: 'ap-northeast-1' | |
| ) |
| import Foundation | |
| class GuessNumber { | |
| lazy var correctNumber: Int = self.randomNumber() | |
| var answerNumber: Int = 0 | |
| var answerCount: Int = 1 | |
| init() { | |
| // Initialize and start game | |
| printGameGuide() |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.List; | |
| import java.util.stream.Stream; | |
| import myClass.MyClass; | |
| class Main { | |
| public static void main(String []args) { | |
| // 特定のクラスのインスタンスを想定 |
| require 'csv' | |
| require 'pp' # pretty print | |
| module EkidataJp;end | |
| module EkidataJp::Exception;end | |
| class EkidataJp::Exception::NoPresentStationCsvHeader < StandardError | |
| def message | |
| 'Please specify some of EkidataJp::CombineStationNameAndPref#station_csv_headers' |