This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class ImageUploader < CarrierWave::Uploader::Base | |
storage :fog | |
def store_dir | |
"hoge/" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/seed.rb | |
AdminUser.find_or_create_by(email: 'admin@example.com') do |m| | |
m.password = 'password' | |
m.password_confirmation = 'password' | |
end | |
AdminUser.find_or_create_by(email: 'myemail@gmail.com') do |m| | |
m.password = 'mypassword' | |
m.password_confirmation = 'mypassword' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
# 他のエラーハンドリングでキャッチできなかった時は、500エラーを発生させる | |
rescue_from Exception, with: :error_500 unless Rails.env.development? | |
# 404エラー |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 21 | |
buildToolsVersion "21.1.2" | |
defaultConfig { | |
applicationId "com.yourname.yourapp" | |
minSdkVersion 15 | |
targetSdkVersion 21 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 関数を定義する | |
-(NSInteger) getHour:(NSDate *)date { | |
// NSCalendarを取得 | |
NSCalendar *calendar = [NSCalendar currentCalendar]; | |
// 取得したい要素(今回はhour)を表すフラグを添えて、日付からその情報を持ったNSDateComponentsを取得。 | |
NSDateComponents *components = [calendar components:NSCalendarUnitHour fromDate:date]; | |
NSInteger hour = components.hour; | |
return hour; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "app", | |
"version": "0.0.1", | |
"description": "grunt環境設定", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "kgmx" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<meta name="viewport" content="width=device-width, user-scalable=no"> | |
<meta name="description" content=""> | |
<meta name="keyword" content=""> | |
<!-- styles --> | |
<link rel="stylesheet" href="css/sample.css" type="text/css" media="all"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main { | |
background-image: image-url("main.png"); | |
background-repeat: no-repeat; | |
background-position: 50% 0; | |
height: 400px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main { | |
background-image: url("main.png"); | |
background-repeat: no-repeat; | |
background-position: 50% 0; | |
height: 400px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main | |
width: 950px | |
margin: 0 atuo | |
p | |
margin: 0 0 1em | |
span | |
color: red |
NewerOlder