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 / 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 / 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 / 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 / seattleWeather_1948-2017.ipynb
Created February 28, 2018 02:16
anaconda3/py_learning/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 / 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 / contact_form_7_select_default.php
Last active June 30, 2017 02:52
WordPress Contact Form 7 selectのデフォルトを動的に
// ex) test_type = 'テスト1'
[select* test_type include_blank default:get "テスト1" "テスト2" "テスト3" "テスト4" "テスト5(test)"]
@maecha
maecha / simple_select_with_hash.rb
Last active June 30, 2017 02:42
HASHから簡易選択 select, select_tag
<%= f.select :hoge_type, options_for_select(Hoge::TYPE_HASH.invert), { include_blank: '選択してください' }, { class: 'test', required: true } %>
<%= select_tag :hoge_type, options_from_collection_for_select(Hoge::TYPE_HASH.invert, :first, :last), { :include_blank => '選択してください' } %>
@maecha
maecha / input_on_click_focus.js
Created May 17, 2017 07:00
インプットをクリックでテキストを選択状態にする
$(document).ready(function(){
$('.jsInputOnClickFocus').focus(function(){
$(this).select();
});
});
@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 / git_settings.sh
Created May 11, 2017 07:27
Gitの設定
git config --global user.name "Your Name"
git config --global user.email you@example.com