Skip to content

Instantly share code, notes, and snippets.

"============================
" General
"============================
" 入力欄に自動フォーカスしない
set focuscontent
" /,? 検索結果をハイライト
set hlsearch
" :oなどでの補完候補をサーチエンジン、履歴に限定
@localdisk
localdisk / typetalk.php
Created February 7, 2014 19:51
typetalk api php sample
<?php
$clientId = 'xxxxxxxxxxxxxxxxxxxx';
$clientSecret = 'xxxxxxxxxxxxxxxxxxxx';
$topicId = 'xxx';
$msg = 'Hello! typetalk! use PHP API!';
$tokenQuery = http_build_query([
'client_id' => $clientId,
@localdisk
localdisk / typetalk.php
Created February 8, 2014 10:56
typetalk api use php (guzzle)
<?php
/**
* 前準備
* 1.Composer をインストールする(https://getcomposer.org/doc/00-intro.md)
* 2.Guzzle をインストール
{
"require": {
"guzzle/guzzle": "dev-master"
}
<?php
/*
|--------------------------------------------------------------------------
| アプリケーションルート
|--------------------------------------------------------------------------
|
| このファイルでアプリケーションの全ルートを定義します。
| 方法は簡単です。対応するURIをLaravelに指定してください。
| そしてそのURIに対応する実行コードをクロージャーで指定します。
@localdisk
localdisk / User.php
Last active August 29, 2015 13:59
Laravel 4.1.26 で UserInterface が変更されたので以下のメソッドを実装する必要があります
<?php
class User extends Eloquent implements UserInterface, RemindableInterface {
// 新たに追加されたメソッドを実装すべし
/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken()
{
@localdisk
localdisk / AddRememberTokenToUsersTable.php
Last active August 29, 2015 13:59
Laravel 4.1.26 で users テーブルに remember_token カラムが必須になった
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddRememberTokenToUserTable extends Migration
{
/**
* Run the migrations.
@localdisk
localdisk / fontconfig.properties
Created May 8, 2014 00:33
fontconfig.properties. NetBeans では <JDKインストールディレクトリ>\jre\lib\fontconfig.properties にコピーする。
# special thanks
# http://www.02.246.ne.jp/~torutk/java/install/jdk7onwindows7.html
#
#
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
#
#
<?php
namespace Backlog;
use GuzzleHttp\Client;
class XmlRpcSample
{
protected $url;
protected $user;
@localdisk
localdisk / pdf.php
Created May 30, 2014 05:02
dompdf, mPDF
<?php
Route::get('dompdf', function()
{
// 前準備として load_font.php で描画に必要なフォントを読み込ませる。
define("DOMPDF_ENABLE_AUTOLOAD", false);
require_once base_path() . "/vendor/dompdf/dompdf/dompdf_config.inc.php";
$domPdf = new DOMPDF();
$domPdf->load_html(View::make('pdf'));
$domPdf->set_paper('A4');
@localdisk
localdisk / routes.php
Created June 30, 2014 01:35
aws/aws-sdk-php-laravel で S3
<?php
Route::get('dir', function()
{
return View::make('dir');
});
Route::post('dir', function()
{
$v = Validator::make(Input::all(), ['name' => 'required']);
if ($v->fails()) {