Skip to content

Instantly share code, notes, and snippets.

Avatar

M_Ishikawa ishikawam

View GitHub Profile
@ishikawam
ishikawam / main.go
Last active Aug 12, 2021
vxlan-to-http-request (http-requests-mirroring)
View main.go
// vxlan-to-http-request (http-requests-mirroring)
// https://github.com/aws-samples/http-requests-mirroring/blob/main/main.go
// getのみmirrorする
// Original Copyright 2012 Google, Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
View LoginController.php
/**
* オレが考えたSocialiteのサンプルコード(いまのところ)
*/
// Social Login
Route::prefix('login/{provider}')->where(['provider' => '(facebook|twitter|github|line)'])->group(function () {
Route::get('/', [App\Http\Controllers\Auth\LoginController::class, 'redirectToProvider'])->name('login.redirect');
Route::get('/callback', [App\Http\Controllers\Auth\LoginController::class, 'handleProviderCallback'])->name('login.callback');
});
@ishikawam
ishikawam / gist:52336f4bb365addc48ed73a231dcd1a3
Created Sep 7, 2018
LIMIAに複数の写真がある場合にヘッダに表示するJS
View gist:52336f4bb365addc48ed73a231dcd1a3
// ==UserScript==
// @name LIMIA show multiple photos
// @namespace M_Ishikawa
// @version 0.1
// @description hoge
// @author Masayuki Ishikawa
// @match https://limia.jp/photo/*
// @grant none
// ==/UserScript==
View SlackCodeSyntaxHighlighter.js
// ==UserScript==
// @name Slack Code Syntax Highlighter
// @namespace M_Ishikawa
// @version 0.1
// @description Click code block, highlight it.
// @author Masayuki Ishikawa
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
View Replace4SpacesWithATabCharacterForSlack.js
// ==UserScript==
// @name Replace 4 spaces with a tab character for Slack.
// @namespace M_Ishikawa
// @version 0.1
// @description Slack 4スペースをタブ文字に変換
// @author Masayuki Ishikawa
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
@ishikawam
ishikawam / file0.txt
Last active May 19, 2018
homebrew/phpがdeprecatedになってしまった件 ref: https://qiita.com/M_Ishikawa/items/e8e6081ca2897bb266eb
View file0.txt
% brew link php71
Warning: php@7.1 is keg-only and must be linked with --force
Note that doing so can interfere with building software.
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc
% php -v
PHP 7.0.29 (cli) (built: Apr 12 2018 03:13:39) ( NTS )
@ishikawam
ishikawam / Handler.php
Last active May 18, 2019
Laravel5: エラーページを共通化〜どんなステータスコードでもどんと来い! ref: https://qiita.com/M_Ishikawa/items/1f0d72fc93286109464e
View Handler.php
/**
* 共通エラーページ
*/
protected function renderHttpException(\Symfony\Component\HttpKernel\Exception\HttpException $e)
{
$status = $e->getStatusCode();
return response()->view("errors.common", ['exception' => $e], $status);
}
@ishikawam
ishikawam / form.sql
Last active Jul 22, 2017
form database
View form.sql
form database
####################################################################
# Dump of table branch
# ------------------------------------------------------------
CREATE TABLE `branch` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`NAME` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
View forelse.twig
{% for user in users %}
{% if not user.subscribed %}
{{ user.name }}
{% endif %}
{% else %}
<p>No users found</p>
{% endfor %}
View forelse.blade.php
@forelse ($user in $user)
@if(!$user->subscribed)
{{ $user->name }}
@endif
@empty
<p>No users found</p>
@endforelse