Skip to content

Instantly share code, notes, and snippets.

Kazuhiro Homma kazuph

Block or report user

Report or block kazuph

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kazuph
kazuph / file0.html
Created Feb 2, 2014
AngularJSでng-repeatした要素ごとに独立した処理を実行させる ref: http://qiita.com/kazuph/items/c098cd75b1208fcc2a85
View file0.html
<div ng-controller="myController">
<div ng-repeat="f in forms">
{{f}}
<input ng-model="data[f]" ng-keyup="doChange(f)">
{{dataTimes[f]}}
</div>
</div>
@kazuph
kazuph / file0.html
Created Feb 4, 2014
子のng-repeatで親のng-repeatのindexを参照したい ref: http://qiita.com/kazuph/items/e625be063feb6b462af0
View file0.html
<div ng-repeat="(fIndex, f) in foos">
<div>
<div ng-repeat="b in foos.bars">
<a ng-click="addSomething(fIndex)">Add Something</a>
</div>
</div>
</div>
@kazuph
kazuph / analytics.rb
Last active Aug 29, 2015
Google Analytics から情報を引っ張ってくるスクリプト。初回はブラウザで認証して、以降はファイルに保存した認証情報を使用する。
View analytics.rb
#!/usr/bin/env ruby
# coding : utf-8
# 参考
# https://github.com/google/google-api-ruby-client
# https://github.com/google/google-api-ruby-client-samples/tree/master/adsense
# https://developers.google.com/api-client-library/ruby/guide/aaa_oauth
# http://blog.naberon.jp/post/2013/08/25/google-analytics-api/
# こっちのモジュールも良さそう
View mv_here_nested_files.rb
#!/usr/bin/env ruby
# coding : utf-8
require 'awesome_print'
require 'pry'
# このスクリプト以下のファイルを見つけたら、このディレクトリに配置する
# 重複を避けるためディレクトリの階層分の名前に変更してmvする
Dir.glob("./**/*").each do |fp|
next if FileTest.directory?(fp)
@kazuph
kazuph / Gemfile
Created Apr 14, 2014
Railsを本番稼働させるときはnginxとsession storeの設定に注意 ref: http://qiita.com/kazuph/items/feb135cda2c6ece24574
View Gemfile
+gem 'activerecord-session_store'
@kazuph
kazuph / ja.yml
Created Apr 14, 2014
rails_adminでenumな値は数字でなくlocaleの値を表示させたい ref: http://qiita.com/kazuph/items/1cff00ae73f7a42d01fb
View ja.yml
ja:
gender:
- '男性'
- '女性'
@kazuph
kazuph / bijo_gif_url.rb
Created Apr 19, 2014
まとめからgif画像のURLを抽出するだけのスクリプト
View bijo_gif_url.rb
require "mechanize"
class BijoGifUrl
class << self
def execute()
new().urls
end
end
@kazuph
kazuph / file0.txt
Created Apr 26, 2014
supervisord + unicornでhot restart (deploy) する ref: http://qiita.com/kazuph/items/55a5f74b9dca2d17bd65
View file0.txt
pip install git+https://github.com/kazuph/unicornherder.git
View file0.go
slice1 = append(slice1, slice2)
@kazuph
kazuph / db.go
Created Apr 30, 2014
gorpでサーバー起動時に自動でCREATE DADABASEする ref: http://qiita.com/kazuph/items/75f8e10d73aeaeb19dd7
View db.go
package main
import (
"database/sql"
"github.com/coopernurse/gorp"
_ "github.com/go-sql-driver/mysql"
"log"
)
type PostInfo struct {
You can’t perform that action at this time.