Skip to content

Instantly share code, notes, and snippets.

- devise_for module_name
- Devise::Mapping
- @scoped_path = options[:as] ? "#{options[:as]}/#{name}" : name.to_s
- @class_name = (options[:class_name] || name.to_s.classify).to_s
```ruby
# Devise::ConfirmationsController#show
def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
@dolpen
dolpen / splatoon_jsons.md
Last active February 8, 2016 18:59
裏イカ研究所

イカの情報をなんとかしてゲーム外から参照したい

  • イカの情報は、公式サイトへの情報反映用に一部がS3にjson形式で置いてあって、人間ががんばれば読めるようになっている
  • S3のベースURLは http://s3-ap-northeast-1.amazonaws.com/splatoon-data.nintendo.net/ である

現在分かっているもの

以下について、現ターム(4時間のアレ)と過去2ターム前までの情報が参照可能

@sgur
sgur / neosnippet_completer.py
Created June 18, 2013 17:59
neosnippet_completer.py
#!/usr/bin/env python
#
# Copyright (C) 2013 Stanislav Golovanov <stgolovanov@gmail.com>
# Strahinja Val Markovic <val@markovic.io>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# 指定したレコードの関連の探索処理
#
# @example
# depth_query = ActiveRecordDepthQuery.new(employee, [attendance: :attendance_records])
# depth_query.each do |relation|
# relation.to_a #=> 1度目は従業員に紐づくAttendanceの一覧、2度目はAttendanceRecordの一覧が返ってくる
# end
class ActiveRecordDepthQuery
include Enumerable
@olivertappin
olivertappin / create-large-file.sh
Last active March 7, 2023 06:36
Create a large file for testing
# Please note, the commands below will create unreadable files and should be
# used for testing file size only. If you're looking for something that has
# lines in it, use /dev/urandom instead of /dev/zero. You'll then be able to
# read the number of lines in that file using `wc -l large-file.1mb.txt`
# Create a 1MB file
dd if=/dev/zero of=large-file-1mb.txt count=1024 bs=1024
# Create a 10MB file
dd if=/dev/zero of=large-file-10mb.txt count=1024 bs=10240