Skip to content

Instantly share code, notes, and snippets.

View michiomochi's full-sized avatar
🤗
Happy!

Michikawa Masayoshi michiomochi

🤗
Happy!
View GitHub Profile
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@znz
znz / date_time_selector.rb
Last active May 31, 2018 13:44
DateTimeSelector の選択肢のテキストの生成部分をもっと汎用的にしてほしい
# -*- coding: utf-8 -*-
# config/initializers/date_time_selector.rb
# based on actionpack-3.2.11/lib/action_view/helpers/date_helper.rb
require "action_view/helpers/date_helper"
class ActionView::Helpers::DateTimeSelector
undef select_day
def select_day
if @options[:use_hidden] || @options[:discard_day]
build_hidden(:day, day || 1)
else
@garethrees
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
@taea
taea / if_class.haml
Last active December 19, 2015 11:19
if ○○だった時だけ classをつける
%span.count-num{ class: "#{'unread' if hoge_count > 0}" }<>= link_to hoge_count, hoge_path