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
@wonderful-panda
wonderful-panda / paizahack_lite.md
Last active August 29, 2015 14:04
paiza オンラインハッカソン lite(https://paiza.jp/poh/kirishima) pythonによるコード #paizahack_lite

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

結果 は0.01秒.

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

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

# -*- coding:utf-8 -*-
@YungSang
YungSang / README.md
Last active August 29, 2015 14:05
Panamax without Installer

Panamax without Installer

for VirtualBox

$ vagrant up
$ open http://localhost:8888

for Parallels Desktop 9

@mornone
mornone / Excel.php
Created July 4, 2012 03:37 — forked from ihumanable/Excel.php
Simple Excel Writer in PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
#!/bin/bash
COMPASS="/var/lib/gems/1.8/bin/compass"
case "$1" in
""|start)
echo "Starting compass watch..."
if [ -f ./cwatch.pid ]
then
echo "Sorry, but compass is already watching this folder..."
@jugyo
jugyo / gist:4071551
Created November 14, 2012 11:07
how to import ekidata for rails

駅データ.jp から以下のようなファイルをダウンロードし、 db/seeds/ekidata とか適当な場所に置く:

  • station20121102free.csv
  • line20121030free.csv
  • company20121010.csv

マイグレーション:

# db/migrate/XXXXXXXXXXXXXX_create_ekidata_stations.rb
@yatt
yatt / createDatabaseAs.sh
Created November 14, 2012 14:30
駅データ.jpのデータをsqlite3に取り込むシェルスクリプト
#! /bin/sh
#
# データベース作成スクリプト.
# 引数に渡されたパスにデータベースを構成・データを投入する
#
#
# sample:
# sh createDatabaseAs.sh db.sqlite3
#
"------------------------------------
" neosnippet
"------------------------------------
" neosnippet "{{{
" snippetを保存するディレクトリを設定してください
" example
" let s:default_snippet = neobundle#get_neobundle_dir() . '/neosnippet/autoload/neosnippet/snippets' " 本体に入っているsnippet
" let s:my_snippet = '~/snippet' " 自分のsnippet
" let g:neosnippet#snippets_directory = s:my_snippet
@jaimalchohan
jaimalchohan / github.rb
Last active January 1, 2016 04:19 — forked from plusjade/github.rb
Updated for breaking changes in ruhoh 2.6
require 'tmpdir'
# Usage:
# add to ruhoh-site/plugins/publish/github.rb
# - Your GitHub remote must be setup properly but The command will try to walk you through it.
# - You must have a clean working directory to publish to GitHub pages since the hook is actually triggered by commits.
#
# $ cd ruhoh-site
# $ bundle exec ruhoh publish github
class Ruhoh
@gouf
gouf / random_name.rb
Last active July 13, 2016 14:28
ちょっと人にやさしいランダムな命名
require 'randexp'
require 'faker'
require 'forgery'
I18n.enforce_available_locales = true
I18n.default_locale = :en
class Randgen
def self.rand_name(options = {})
/#{Forgery::Basic.color}-#{Faker::Name.first_name}-\d{4}/.gen.downcase
@mochizuki-masao
mochizuki-masao / count.rb
Last active September 8, 2016 17:50
S3_count_storage_size
#!/usr/bin/env ruby
require 'aws-sdk'
require 'optparse'
begin
require 'aws/profile_parser'
rescue LoadError; end
def conv_unit size