Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/sh | |
# About rerun: [alexch/rerun: Restarts an app when the filesystem changes. Uses growl and FSEventStream if on OS X.](https://github.com/alexch/rerun/) | |
# About yard: [YARD - A Ruby Documentation Tool](https://yardoc.org/) | |
# Note: specify `-d [directory where not same directory level of .yard]` option to avoid endless loop | |
rerun -d app -c "rm -rf .yard && yard doc && ./yard_server.sh restart" |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# Ref: * [Railsで今月のカレンダーを生成するerbコード - Qiita](https://qiita.com/nnabeyang/items/8b54a28551983d9cdb32) | |
# put into... app/helpers/calendar_table_helper.rb | |
# <table/> タグを用いてカレンダーを生成する | |
module CalendarTableHelper | |
def calendar_table_tag(today = Date.today) | |
tag.table do | |
calendar_caption(today) + | |
calendar_header + | |
calendar_body(today) | |
end |
「/login」に移動する
「username」フィールドに「admin」と入力する
#!/home/gouf/.anyenv/envs/rbenv/shims/ruby | |
# vim: ft=ruby | |
Dir.chdir(Dir.pwd) | |
# | |
# リポジトリ/ユーザ名の抽出 | |
# | |
origin = %x(git remote -v) |
バージョンごとに新規作成するコマンドがあったらベンリかもしれないと思った
# 2体のポケモンを戦わせる | |
class PokemonBattle | |
def initialize(pokemon_a, pokemon_b) | |
@turn_count = 0 | |
@players = [pokemon_a, pokemon_b] | |
end | |
def game_start! | |
print_initial_situation | |
loop do |
# Ref: [PHP - タイ順位を表示させたい(95165)|teratail](https://teratail.com/questions/95165) | |
target = [[100] * 2, [97] * 3, [90] * 5].flatten | |
# => [100, 100, 97, 97, 97, 90, 90, 90, 90, 90] | |
def combine_rank_label(desc_sorted_list) | |
rank_index = 1 | |
rank_value_cache, *target = desc_sorted_list |
// Define functions | |
upDownCycleNumber = function(cycleLength) { | |
// Setup function | |
// Create an array like: | |
// [0, 1, 2, 3, 4, 5, 4, 3, 2, 1] | |
createUpDownCyclesArray = function(cycleLength) { | |
// Create an array like: | |
// [0, 1, 2, 3, 4, 5] | |
incrementalArray = | |
Array.apply(null, Array(cycleLength + 1)) |