Skip to content

Instantly share code, notes, and snippets.

View graffiti-withwind's full-sized avatar

withwind graffiti-withwind

  • japan, Hiroshima
View GitHub Profile
@graffiti-withwind
graffiti-withwind / composer-install-script
Last active December 10, 2019 12:56
[cmd] Composerのインストールコマンド
REM Composer Ver 1.9.1
REM https://getcomposer.org/download/
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
@graffiti-withwind
graffiti-withwind / laravel-api-token-auth.php
Created August 10, 2017 09:17
[Laravel5.4] APIトークン認証
<script>
/*
* Laravel 5.4 の routes/api.php に書かれているルーティングにアクセスする。
*
* Laravel-mixで導入される通信ライブラリ「axios」を使ったサンプル。
* [axios] https://github.com/mzabriskie/axios
*
* apiにアクセスする場合はユーザー(usersテーブル)のapi_tokenの値が必要になる。
*/
@graffiti-withwind
graffiti-withwind / php-class-static.php
Last active August 8, 2017 08:34
[PHP] PHP の static の挙動確認
<?php
/*
* PHP の static の挙動確認
*/
class A {
public static function get_self() {
return new self();
}
public static function get_static() {
return new static();
@graffiti-withwind
graffiti-withwind / php_static-class.php
Created August 4, 2017 10:10
[PHP] staticの有無でのクラスの挙動確認
<?php
/*
* Classのstaticの挙動確認
*
*/
/*
* static を使ったクラスのルール。
*
<?php
/**
* PHPのClass
*/
class PhpClass
{
/*
* プロパティ
*/
public $public_property = 'public_property';
@graffiti-withwind
graffiti-withwind / laravel-session-flash.md
Last active July 28, 2017 08:59
[Laravel] Session(Flash)の使い方
@graffiti-withwind
graffiti-withwind / uikit-navbar-stickyfooter-offcanvas-layout-flexbox.html
Created July 26, 2017 11:45
[UIKIT] Navbar-StickyFooter-Offcanvas Layout(Flexbox)
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>UIKIT > Basic Page Layout(Flexbox)</title>
<!-- UIkit CSS -->
@graffiti-withwind
graffiti-withwind / uikit-navbar-stickyfooter-offcanvas-layout.html
Last active July 26, 2017 11:33
[UIKIT] Navbar-StickyFooter-Offcanvas Layout
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>UIKIT Navbar-StickyFooter-Offcanvas Layout</title>
<!-- UIkit CSS -->
@graffiti-withwind
graffiti-withwind / wordpress-disable-author-archive
Created July 19, 2017 10:59
[WORDPRESS]投稿者アーカイブの無効化
/*
* 投稿者アーカイブの無効化
*
* テーマファイルのfunction.phpに以下のコードを追記する。
*/
add_filter( 'author_rewrite_rules', '__return_empty_array' );
function disable_author_archive() {
if ( $_GET['author'] || preg_match( '#/author/.+#', $_SERVER['REQUEST_URI'] ) ) {
wp_redirect( home_url( '/404.php' ) );
exit;
@graffiti-withwind
graffiti-withwind / htaccess_trailing_slash
Created June 29, 2017 08:00
[Laravel][htaccess] トレイリングスラッシュの付与
#
# url rewrite
#
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
#
# [Apache]ディレクトリにはスラッシュを付けるmod_dirの挙動