Skip to content

Instantly share code, notes, and snippets.

@shu0115
shu0115 / file0.txt
Created February 9, 2015 16:06
Railsで開発している時によく使う/たまに使うメソッド集 ref: http://qiita.com/shu_0115/items/cc2357441fece13bad5e
nil.aaa
# => NoMethodError: undefined method `aaa' for nil:NilClass
@shu0115
shu0115 / file0.txt
Last active August 29, 2015 14:14
Ruby便利メソッドまとめ:Array/Hash/Enumerator ref: http://qiita.com/shu_0115/items/5f08a6d58d1acc46fbad
[1, nil, 2, nil, 3, nil].compact
# => [1, 2, 3]
@shu0115
shu0115 / file0.txt
Created December 22, 2014 08:23
Ruby on Rails 4.2 個人的な気になるポイント ref: http://qiita.com/shu_0115/items/c04ebcf9b4d4fa8b76ea
get '/posts', to: MyRackApp => (変更不要)
get '/posts', to: 'post#index' => (変更不要)
get '/posts', to: 'posts' => get '/posts', controller: :posts
get '/posts', to: :index => get '/posts', action: :index
@shu0115
shu0115 / file0.txt
Created December 1, 2014 01:28
Ruby 2.1.5アップデート - Mac OS X 10.9.4 ref: http://qiita.com/shu_0115/items/257bcb671c686849845b
brew update
----------
Updated Homebrew from 04771ec8 to e89d1e75.
==> New Formulae
chinadns-c smali synscan ucommon
==> Updated Formulae
ansible flac jenkins mplayershell wimlib
assimp flow juju neo4j wireshark
cfengine fontforge libksba ninja wxpython
clamav git liboping percona-server xz
@shu0115
shu0115 / file0.txt
Last active September 12, 2017 06:09
Herokuのメリット、デメリット ref: http://qiita.com/shu_0115/items/0106198f7a0be2f2a509
=== APP-NAME Releases
v50 Deploy 45de3e3 xxxxxxxxxx@gmail.com 2014/11/25 17:37:55 (~ 27m ago)
v49 Deploy ff3082d xxxxxxxxxx@gmail.com 2014/11/25 16:49:20 (~ 1h ago)
v48 Deploy 0508f80 xxxxxxxxxx@gmail.com 2014/11/25 14:05:57 (~ 3h ago)
v47 Deploy cfed7f8 xxxxxxxxxx@gmail.com 2014/11/25 13:44:55 (~ 4h ago)
v46 Deploy e847a65 xxxxxxxxxx@gmail.com 2014/11/25 12:27:30 (~ 5h ago)
v45 Deploy 0848019 xxxxxxxxxx@gmail.com 2014/11/25 12:14:57 (~ 5h ago)
v44 Deploy 5a5b056 xxxxxxxxxx@gmail.com 2014/11/25 11:56:16 (~ 6h ago)
v
Tasks = new Mongo.Collection("tasks");
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: function () {
if (Session.get("hideCompleted")) {
// If hide completed is checked, filter tasks
return Tasks.find({checked: {$ne: true}}, {sort: {createdAt: -1}});
} else {
<head>
<title>Todo List</title>
</head>
<body>
<div class="container">
<header>
<h1>Todo List ({{incompleteCount}})</h1>
<label class="hide-completed">
Tasks = new Mongo.Collection("tasks");
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: function () {
if (Session.get("hideCompleted")) {
// If hide completed is checked, filter tasks
return Tasks.find({checked: {$ne: true}}, {sort: {createdAt: -1}});
} else {
<head>
<title>Todo List</title>
</head>
<body>
<div class="container">
<header>
<h1>Todo List ({{incompleteCount}})</h1>
<label class="hide-completed">
Tasks = new Mongo.Collection("tasks");
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: function () {
// Show newest tasks first
return Tasks.find({}, {sort: {createdAt: -1}});
}
});