Skip to content

Instantly share code, notes, and snippets.

View serihiro's full-sized avatar

Kazuhiro Serizawa serihiro

View GitHub Profile
@serihiro
serihiro / jsonp_sample.php
Created May 30, 2012 09:21
JSONP API SAMPLE
<?php
/*
*
This JSONP API returns jsonp function call to JS script which called this JSONP API.
@response:
{*callback function name*}({[foo: "homhom"] , [bar: "anan"]});
*
@serihiro
serihiro / htmltmp.html
Created June 21, 2012 14:18
HTML5 Template
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="" type="text/css">
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
@serihiro
serihiro / lotationLog.sh
Created June 30, 2012 16:10
Log lotation script
#! /bin/sh
#
# This script excutes to archive log daily, and
# delete archived file whose timestamp is over day period you setted.
TODAY=`date +%Y-%m-%d`
#Directory you put logs. (ex '/home/app/program/log'
@serihiro
serihiro / GroongaHTTPUtil.php
Created August 15, 2012 01:23
Groonga through HTTP Utility for PHP
<?php
class GroongaUtil{
/*
* This Class is Utility for Groonga with HTTP.
*
* Groonga is an open-source fulltext search engine and column store.
* For detail of Groonga , see following web site.
* http://groonga.org/
*
@serihiro
serihiro / cronko.php
Created August 17, 2012 23:36
cronko.php (for internal)
<?php
include "sitesetting.php";
include "setting.php";
$db = mysqli_connect( $dbHost, $dbUser, $dbPass, $dbName );
if( mysqli_connect_errno() ){
die("データベースとの接続に失敗しました。:" . mysqli_connect_error());
}else{
@serihiro
serihiro / gist:3816984
Created October 2, 2012 07:11
Subversion install configure option
[apr]
./configure \
--prefix=/usr/local/apr \
--enable-threads
[apr-util]
./configure \
--prefix=/usr/local/apr-util \
--with-apr=/usr/local/apr \
@serihiro
serihiro / gist:3911370
Created October 18, 2012 11:59
If your PC failed to windows update...
ただし、問題もある為、マイクロソフトも一般には公開していません。
(マイクロソフトのUSサイトで去年見つけました)
問題点とは、この方法を行うと過去のアップデートの履歴が全て消えてしまう事です。
(なのでマイクロソフトのサポートではこの方法を教えてくれません)・・・現在は教えてくれているかもしれません
ですので本当に「Windows Update」に失敗して困っている方のみ行って下さい。
手順は非常に簡単です。
1.「Automatic Updates」サービスを停止する。
  「コントロールパネル」→「パフォーマンスとメンテナンス」→
@serihiro
serihiro / gist:8534040
Last active January 3, 2016 23:19
応用情報技術者試験対策

応用情報技術者試験対策

自分が受けたのは社会人3年目、SIerでSEをやってた頃に受けた2011年特別試験枠(震災で春試験が延期になったやつ)でした。
午前・午後とも8割ぐらい取って受かりました。

その時の過去問

勉強の仕方

あんまり覚えてないのですが記憶の範囲でとりあえず書きます。

@serihiro
serihiro / gist:0da1d5b680ad530d606c
Last active August 29, 2015 14:06
箱根旅行プラン案
@serihiro
serihiro / gist:d548f568e522adefa49c
Created October 15, 2014 11:51
Rails.logger.debug('hoge')のソースがどのように呼ばれてるかをおっかけた

適当にモンキーパッチ当ててRails.logger.debug('hoge')で死ぬようにする

def add(severity, message = nil, progname = nil, &block)
    severity ||= UNKNOWN
    if @logdev.nil? or severity < @level
      return true
    end
 progname ||= @progname