Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Maechan maecha

🏠
Working from home
View GitHub Profile
@maecha
maecha / get_datetime_from_time.rb
Last active Mar 29, 2018
Get the datetime from time. / E.g. From request params
View get_datetime_from_time.rb
def get_datetime_converted_from_time
time = Time.zone.now
splited_time = params[:object][:time].split(':')
local_time = Time.local(
time.year,
time.month,
time.day,
splited_time.first.to_i,
splited_time.last.to_i,)
@maecha
maecha / seattleWeather_1948-2017.ipynb
Created Feb 28, 2018
anaconda3/py_learning/seattleWeather_1948-2017.ipynb
View seattleWeather_1948-2017.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maecha
maecha / hello.mat
Created Mar 2, 2018
.mat シンタックスコードハイライト確認
View hello.mat
# Created by Octave 3.8.0, Fri Mar 02 15:06:33 2018 JST <seiyamaeda@SeiyanoMacBook-Pro.local>
# name: A
# type: matrix
# rows: 3
# columns: 2
1 2
2 4
5 6
@maecha
maecha / check_isnull_data.ipynb
Last active Mar 3, 2018
anaconda3/ml_learning/kaggle/check_isnull_data.ipynb
View check_isnull_data.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maecha
maecha / titanic.ipynb
Last active Mar 5, 2018
The first attack Titanic: Machine Learning from Disaster for Competition
View titanic.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maecha
maecha / CLI
Last active Apr 6, 2018
Update select box when another one is updated. / E.g. Hoge and Fuga are 'one-to-many relationship', and use a controller 'Piyo' without this association .
View CLI
$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
$ bundle exec rails -v
Rails 5.1.4
@maecha
maecha / app|views|hoges|new.html.slim
Last active Mar 29, 2018
Open modal view on AdminLTE ver2 (with Bootstrap 3.3.6)
View app|views|hoges|new.html.slim
/ the way it uses font awesome
= link_to '#', data: { toggle: 'modal', target: '#hoge-modal' } do
i.fa.fa-question-circle
end
== render partial: 'layouts/shared/modals/hoge'
@maecha
maecha / Gemfile
Last active Mar 31, 2018
Kaminari on 'Ruby on Rails 5.1.4'
View Gemfile
gem 'kaminari'
@maecha
maecha / app|assets|javascripts|hoge.coffee
Last active Apr 2, 2018
How to make the disabled-link with CoffeeScript / for Ruby on Rails 5.1.4
View app|assets|javascripts|hoge.coffee
$(document).on 'turbolinks:load', ->
do ->
$('.disabled-link').click (e) ->
e.preventDefault()
return
@maecha
maecha / Gemfile
Last active Apr 3, 2018
How to use 'Cocoon' | Ruby on Rails 5.1.4 | AdminLTE ver2 (with Bootstrap 3.3.6) | Model 'Hoge' and 'Model 'Fuga' are 'one-to-many relationship'
View Gemfile
gem 'cocoon'
gem 'jquery-rails'