Skip to content

Instantly share code, notes, and snippets.

View maecha's full-sized avatar
🏠
Working from home

Maechan maecha

🏠
Working from home
View GitHub Profile
@maecha
maecha / hello.mat
Created March 2, 2018 06:08
.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 March 3, 2018 07:53
anaconda3/ml_learning/kaggle/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 March 5, 2018 11:45
The first attack Titanic: Machine Learning from Disaster for Competition
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maecha
maecha / app|views|hoges|new.html.slim
Last active March 29, 2018 07:02
Open modal view on AdminLTE ver2 (with Bootstrap 3.3.6)
/ 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 / get_datetime_from_time.rb
Last active March 29, 2018 07:17
Get the datetime from time. / E.g. From request params
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 / only_send_email_to_user.rb
Last active March 29, 2018 07:20
メール送信だけ
def send_email_to_user
email_params = {
subject: params[:subject],
to_email: params[:to_email],
from_email: params[:from_email],
description: params[:description],}
HogeMailer.send_email_to_user(email_params)
render :nothing => true
end
@maecha
maecha / Gemfile
Last active March 31, 2018 03:29
Kaminari on 'Ruby on Rails 5.1.4'
gem 'kaminari'
@maecha
maecha / app|assets|javascripts|hoge.coffee
Last active April 2, 2018 07:34
How to make the disabled-link with CoffeeScript / for Ruby on Rails 5.1.4
$(document).on 'turbolinks:load', ->
do ->
$('.disabled-link').click (e) ->
e.preventDefault()
return
@maecha
maecha / Gemfile
Last active April 3, 2018 06:58
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'
gem 'cocoon'
gem 'jquery-rails'
@maecha
maecha / app|assets|javascripts|application.js
Last active April 3, 2018 07:15
How to use DatePicker in AdminLTE ver2 (with Bootstrap 3.3.6)
:
:
//= require admin-lte/plugins/datepicker/bootstrap-datepicker
//= require admin-lte/plugins/datepicker/locales/bootstrap-datepicker.ja