Skip to content

Instantly share code, notes, and snippets.

@Khanashima
Khanashima / file0.txt
Created May 4, 2016 12:32
MySQL ver5.7でrootのパスワードを忘れた場合の再設定方法 ref: http://qiita.com/kiimiiis/items/a8a47bc3065779e1dc0d
[root@vagrant-centos65 log]# service mysqld stop
[root@vagrant-centos65 log]# mysqld_safe --skip-grant-tables &
mysql> use mysql;
mysql> UPDATE mysql.user
-> SET authentication_string = PASSWORD('新パスワード'), password_expired = 'N'
-> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
@Khanashima
Khanashima / file0.txt
Created April 21, 2016 16:49
vagrant(CentOS6.7)でApache2.4+PHP7+MySQL5.7のインストール方法 ref: http://qiita.com/kiimiiis/items/1a38a13c00bf3ea71405
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = "2048"
end
@Khanashima
Khanashima / file0.txt
Created March 13, 2016 13:54
vagrant(ホストがwindows)のsynced_folder上でSymfonyをインストールできない時の対応方法 ref: http://qiita.com/kiimiiis/items/8ab1026c3ddb9fd49671
[root@vagrant-centos65 vagrant]# composer create-project symfony/framework-standard-edition my_project_name "2.8.3"
[RuntimeException]
Could not delete /vagrant/my_project_name/vendor/symfony/symfony/6601b6eabe2135f7d417614c11d56528: date_default_timezone_get(): It is not safe to rely on the syste
m's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and y
ou are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to sele
ct your timezone.
@Khanashima
Khanashima / file0.txt
Created February 14, 2016 14:34
windowsでPHPでSelenium webdriverを使ってブラウザテスト ref: http://qiita.com/kiimiiis/items/30e173a3950e09816921
C:\D\selenium>java -jar selenium-server-standalone-2.52.0.jar -role hub -port 4445
C:\D\selenium>java -jar selenium-server-standalone-2.52.0.jar -role node -hub http://localhost:4445/grid/register
@Khanashima
Khanashima / file0.txt
Last active February 14, 2016 13:52
Selenium Serverが立ち上がらないときはportが被っているかも!? ref: http://qiita.com/kiimiiis/items/2c26cf47a923e09c93a0
java -jar selenium-server-standalone-2.52.0.jar -role hub
@Khanashima
Khanashima / Main2Activity.java
Last active February 6, 2016 15:09
deprecatedのないTab画面の作成方法 ref: http://qiita.com/kiimiiis/items/34a6fc3df279300b60bd
public class Main2Activity extends AppCompatActivity implements Tab1Fragment.OnFragmentInteractionListener, Tab2Fragment.OnFragmentInteractionListener {
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//QiitaApiの使用
Retrofit retrofit = new Retrofit.Builder()
@Khanashima
Khanashima / file0.txt
Last active January 23, 2016 15:51
【Python】pandasのSeries、DataFrameとは ref: http://qiita.com/kiimiiis/items/0e1646adf0dab0061845
#数値計算ライブラリインポート
import numpy
#データ分析ライブラリからSeriesとDataFrameをインポート
from pandas import Series, DataFrame
#Series
#data仮引数 : データ。array-like, dict, or scalar value
#index仮引数 : データの添え字。array-like or Index (1d)
#dtype仮引数 : データタイプ。numpy.dtype or None
#copy仮引数 : コピー。デフォルトはfalse
@Khanashima
Khanashima / file0.java
Last active January 11, 2016 14:00
Androidのインテントを使った複数宛先のメール送信 ref: http://qiita.com/kiimiiis/items/53a484374e40ceff8956
List<String> emails = new ArrayList<>();
StringBuilder mailTo = new StringBuilder();
mailTo.append("mailto:");
for (String email : emails) {
if(android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
//正しいメアドの時だけ追加する
mailTo.append(email);
mailTo.append(",");
}
}
@Khanashima
Khanashima / CRecipientRepository.java
Last active January 2, 2016 17:11
Androidアプリ開発でDIのDagger2の使用方法 ref: http://qiita.com/kiimiiis/items/20c3fa79988ed3ccb3c9
@Component(modules = RecipientRepositoryModule.class)
public interface CRecipientRepository {
IRecipientRepository maker();
}