Skip to content

Instantly share code, notes, and snippets.

View maimai-swap's full-sized avatar

S. Ishimaru maimai-swap

  • individual
  • Japan
View GitHub Profile
@maimai-swap
maimai-swap / nazo.js
Created April 23, 2016 07:07
nazo.js
// これがうまく行って
$.each(reserve_ids,function(index,elem) {
$.ajax({
type: "GET",
url: "execute.php",
success: function(data){
// いろいろ
},
error: function(data) {
// いろいろ
@maimai-swap
maimai-swap / diff.sh
Created February 20, 2016 08:24
diffでスペースとかタブとかスペースの数とか無視する
diff -wbEB views/sp/confirm.tmpl.php views/tablet/confirm.tmpl.php
@maimai-swap
maimai-swap / laravel.log
Created January 1, 2016 11:37
Laravel 5.2 socialite twitter認証で$this->request->getSession()がnullを返すのだが、これは何のせいかとローカルでやってたのをhomesteadでも試したけど同じ結果になった。
[2016-01-01 20:27:57] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Fatal error: Call to a member function set() on null in /home/vagrant/tweetranking/vendor/laravel/socialite/src/One/AbstractProvider.php:49
Stack trace:
#0 /home/vagrant/tweetranking/app/Http/Controllers/Auth/AuthController.php(82): Laravel\Socialite\One\AbstractProvider->redirect()
#1 [internal function]: App\Http\Controllers\Auth\AuthController->redirectToProvider()
#2 /home/vagrant/tweetranking/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(76): call_user_func_array(Array, Array)
#3 /home/vagrant/tweetranking/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(146): Illuminate\Routing\Controller->callAction('redirectToProvi...', Array)
#4 /home/vagrant/tweetranking/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(94): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\Auth\AuthController), Object(Illuminate\Routing\Route), 'redirectToP
@maimai-swap
maimai-swap / spec_helper.rb
Created June 20, 2015 06:37
railstutorial 5.3.4 NoMethodError: undefined method `full_title' for #<RSpec::ExampleGroups::StaticPages::HomePage:0x007fbd94a315e8>
require "support/utilities"
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
@maimai-swap
maimai-swap / file0.txt
Last active August 29, 2015 14:18
aws cli でのiamユーザー作成 ref: http://qiita.com/maimai-swap/items/749642b54160443e6a1f
AWS_PROFILE_NAME=test # 作りたいところのプロフィール名
USER_NAME=test-user # ユーザー名
PASSWORD=iD8Bkcd4-JrxUXQ5v # 初期パスワード
GROUP_NAME=developer # グループ名 先にiamで作っとく必要あります。
@maimai-swap
maimai-swap / td-agent-source.conf
Last active August 29, 2015 14:18
td-agent Apache ltsv
<source>
type config_expander
<config>
type tail
format ltsv
time_format %d/%b/%Y:%H:%M:%S %z
path XXXXXXXXXXXXXXXXXXX
tag apache.access
pos_file /var/log/td-agent/apache.access.pos
</config>
@maimai-swap
maimai-swap / apache-log-ltsv.conf
Last active August 29, 2015 14:18
ltsvで出すApacheのログconfig
LogFormat "host:%h\tident:%l\tuser:%u\ttime:%{%d/%b/%Y:%H:%M:%S %z}t\tmethod:%m\tpath:%U%q\tprotocol:%H\tstatus:%>s\tresponse-size:%b\trefer:\"%{Referer}i\"\tuser-agent:\"%{User-Agent}i\"\tx-forwarded-for:\"%{X-Forwarded-For}i\"\tquery:\"%q\"\tcookie:\"%{cookie}i\"" ltsv
CustomLog logs/access_log ltsv
@maimai-swap
maimai-swap / user-ope.sh
Created March 25, 2015 11:28
ユーザーのグループへの追加、ユーザーのグループからの削除、ユーザー自体の削除
# ユーザーのグループへの追加
AWS_PROFILE_NAME="AWS cli のProfile名"
USER_NAMES="ユーザー名"
GROUP_NAME="グループ名"
for USER_NAME in $USER_NAMES
do
aws iam add-user-to-group --group-name $GROUP_NAME --user-name $USER_NAME --profile $AWS_PROFILE_NAME
done
exit
@maimai-swap
maimai-swap / check-groups.sh
Last active August 29, 2015 14:17
iamのグループとグループに入ってるユーザーをチェックする
#!/bin/sh
AWS_PROFILE_NAME=$1
groups=$(aws iam list-groups --query Groups[][GroupName] --profile $AWS_PROFILE_NAME --output text)
for group_name in $groups
do
aws iam get-group --group-name $group_name --query [Group.GroupName,Users[][UserName]] --profile $AWS_PROFILE_NAME
# inline policies
@maimai-swap
maimai-swap / create-user.sh
Last active August 29, 2015 14:17
AWS cliでiamユーザー作ってグループに入れる。
#!/bin/sh
# 環境のaws cli profile
AWS_PROFILE_NAME=$1
# 環境のaws cli profileをアカウント名のsuffixにする
AWS_SYSTEM_ID=$AWS_PROFILE_NAME
# ユーザー名
USER_NAME=$2
# パスワード
PASSWORD=$3