Skip to content

Instantly share code, notes, and snippets.

@jehaby
jehaby / README.md
Last active June 5, 2023 07:53 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug
View README.md

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@mypacecreator
mypacecreator / functions.php
Last active March 1, 2017 08:46
WordPress ログイン時にダッシュボードではなくサイトトップへ飛ばす
View functions.php
<?php
//管理者以外はログイン成功後ダッシュボードではなくトップページへ飛ばす
function redirect_login_front_page() {
if( !current_user_can('administrator') ){
$home_url = site_url('', 'http');
wp_safe_redirect($home_url);
exit();
}
}
@naosim
naosim / renameGitBranch.md
Last active November 29, 2023 07:50
ローカルとリモートのブランチ名を変更する
View renameGitBranch.md

#ローカルとリモートのブランチ名を変更する

以下、ブランチ名を hoge から foo に変更する例

  • ローカルのブランチ名変更
git branch -m hoge foo
  • リモートのブランチを消す
@isimmons
isimmons / gist:8202227
Last active November 18, 2022 00:39
Truncate tables with foreign key constraints in a Laravel seed file.
View gist:8202227

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');