Skip to content

Instantly share code, notes, and snippets.

@jehaby
jehaby / README.md
Last active January 25, 2024 14:43 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

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 ログイン時にダッシュボードではなくサイトトップへ飛ばす
<?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 December 20, 2023 12:09
ローカルとリモートのブランチ名を変更する

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

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

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

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');