Skip to content

Instantly share code, notes, and snippets.

@sharkpp
sharkpp / research-of-javascript-and-css-cdn.php
Created March 6, 2016 12:13
「JavaScriptや CSS の CDN サービスについて調べてみた」 http://www.sharkpp.net/blog/2016/03/06/research-of-javascript-and-css-cdn.html 調査用スクリプト
<?php
// This code licensed under The MIT license.
// Copyright (c) 2016 sharkpp all right reserved.
// usage:
// php research-of-javascript-and-css-cdn.php
$cmd = 'curl -kL "%s" -o /dev/null -w "%%{http_code}\t%%{time_total}" 2> /dev/null';
$list = [
'jQuery' => [
@sharkpp
sharkpp / favo_recipe_backup_merge.php
Created March 5, 2016 07:01
Favo Recipe の複数のバックアップデータをマージしようとして失敗した残骸
<?php
// これはなに?
// Favo Recipe - https://play.google.com/store/apps/details?id=jp.yy_soft.favo_recipe&hl=ja
// の複数のバックアップデータをマージしようとして失敗した残骸
// 準備
// バックアップデータの in1/FR を SQLite3 で読み込み [1-3].sql としたものを準備
// 実行
// 実行すると、一部のテーブルのマージ結果と画像コピー用のコマンドラインが出力されるので
// 適当に切り張りしてSQLを作ってデータベースを作る
@sharkpp
sharkpp / website-registration-using-twitter-dm.md
Last active February 28, 2016 07:09
Twitter ID での仮登録/正式登録の認証方法の提案

※ Haroopad とかで確認してね!

    sequenceDiagram

    participant ユーザー
    participant Twitter
    participant ウェブサイト
    participant データベース
@sharkpp
sharkpp / .htaccess
Last active December 29, 2015 19:29
index.phar 用 .htaccess
Options +FollowSymLinks
DirectoryIndex index.phar
AddType application/x-httpd-php .phar
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ index.phar?/$1 [QSA,L]
@sharkpp
sharkpp / mkphar.php
Last active December 29, 2015 19:19
FuelPHP を Phar にまとめるためのスクリプト
<?php
/*
* Copyright (c) 2013 sharkpp
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*/
// 確実に削除
@unlink('index.phar');
// phar書庫作成のためクラスを生成
$phar = new Phar(__DIR__ . '/index.phar', 0, 'index.phar');
@sharkpp
sharkpp / fuelphp_phar_fix.patch
Last active December 29, 2015 19:18
Phar::webPhar() を使い FuelPHP 1.7 を動かすための変更点
diff U5 fuel/app/config/asset.php fuel/app/config/asset.php
--- fuel/app/config/asset.php Thu Jan 01 09:00:00 1970
+++ fuel/app/config/asset.php Sat Nov 30 11:49:43 2013
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Part of the Fuel framework.
+ *
+ * @package Fuel
+ * @version 1.7
@sharkpp
sharkpp / gist:7601323
Created November 22, 2013 15:04
あるオブジェクトの親クラス(派生元クラス)のメソッドを外部から呼び出す
<?php
class C
{
private $a;
function __construct($owner)
{
$this->a = $owner;
}

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6

「段落」をつくる(<p>タグで囲まれた文章)には、二つ以上の改行を入れます。