Skip to content

Instantly share code, notes, and snippets.

View ANNotunzdY's full-sized avatar
🚩
I may be slow to respond.

あんのたん® ANNotunzdY

🚩
I may be slow to respond.
View GitHub Profile
@JadenGeller
JadenGeller / Swift Dictionary Map Filter Reduce.swift
Created March 27, 2015 04:24
Swift Dictionary Map/Filter/Reduce
extension Dictionary {
init(_ elements: [Element]){
self.init()
for (k, v) in elements {
self[k] = v
}
}
func map<U>(transform: Value -> U) -> [Key : U] {
return Dictionary<Key, U>(Swift.map(self, { (key, value) in (key, transform(value)) }))
@totutote
totutote / README.md
Created April 22, 2012 14:47 — forked from wtnabe/README.md
import seed data from .csv or .yml for Rails 3.2+ Ruby 1.9.3+

Rails SeedImporter

  1. Put this code at #{Rails.root}/db/seeds.rb
  2. type rake db:setup

rake db:seed で変更のあったレコードのみ更新

Limitation

ja:
errors:
messages:
not_found: "は見つかりませんでした"
# not_found: "not found"
already_confirmed: "は既に登録済みです"
# already_confirmed: "was already confirmed"
not_locked: "は凍結されていません"
# not_locked: "was not locked"