Skip to content

Instantly share code, notes, and snippets.

View gouf's full-sized avatar
😇
I don't know how my life work with.

Go Furuya gouf

😇
I don't know how my life work with.
View GitHub Profile
@gouf
gouf / web-servers.md
Created February 3, 2018 19:13 — forked from willurd/web-servers.md
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
北海道
青森県
岩手県
宮城県
秋田県
山形県
福島県
茨城県
栃木県
群馬県
@gouf
gouf / capybara cheat sheet
Created April 1, 2016 08:46 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@gouf
gouf / recfile.rb
Last active November 4, 2015 22:35 — forked from tumugin/recfile.rb
require 'fileutils'
class TermColor
class << self
# 色を解除
def reset
c 0
end
# カラーシーケンスを出力する
@gouf
gouf / Unmerge.bas
Last active September 4, 2015 04:55 — forked from kos59125/Unmerge.bas
アクティブシートの結合されたセルの結合を解除して,すべてのセルの値を結合元のセルの値で埋めます。
Option Explicit
' アクティブシートの結合されたセルの結合を解除して,すべてのセルの値を結合元のセルの値で埋めます。
Public Sub Unmerge()
Dim OuterCell As Variant
Dim InnerCell As Variant
Dim Value As Variant
Dim Updating As Boolean ' 現在のスクリーン更新状態
Updating = Application.ScreenUpdating
@gouf
gouf / times.js
Last active August 29, 2015 14:21 — forked from FGRibreau/times.js
// Ruby = 5.times { |i| puts i }
// JS = (1).times(function(i){console.log(i);})
Number.prototype.times = function(cb) {
var i = -1;
while (++i < this) {
cb(i);
}
return +this;
あいて = %w(ぐー ちょき ぱー)
じゃんけん = { :"ぐー" => 0,
:"ちょき" => 1,
:"ぱー" => 2}
loop do
print 'じゃんけん... :'
ぷれいやーの手 = gets.chomp
@gouf
gouf / README.md
Last active August 29, 2015 14:07 — forked from linjunpop/README.md

paizaオンラインハッカソン lite をPythonで解いてみた.

結果 は0.01秒.

単純に枝刈りしながら深さ優先探索するだけのコードだけど, あらかじめ単価の安い順にソートしておくのと, Solver.least_cost() あたりの処理とで出来るかぎり浅いところで枝刈りされるようにしている.

とはいえ、このコードで TestCase7が0.01秒というのはちょっと速すぎる気がしないでもない.

# -*- coding:utf-8 -*-