Skip to content

Instantly share code, notes, and snippets.

View ahomu's full-sized avatar

Ayumu Sato ahomu

View GitHub Profile
@ahomu
ahomu / css2inline.php
Created January 28, 2011 05:04
head内のCSSをインラインに置き換える ゆるふわPHP
<?php
/**
* まだ途中. とりあえずCSSをセレクタとプロパティに大ざっぱに分割したとこ
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
$resourse = <<< DOC_END
@ahomu
ahomu / JapanMapChart.php
Created February 7, 2011 07:01
Japan Map Chart (using aka Chart API)
<?php
// http://code.google.com/intl/ja/apis/chart/docs/gallery/new_map_charts.html
// detectColorメソッドを実装して,値に対して色(16進数)を割り振る
abstract class JapanMapChart
{
private
$_baseUrl,
$_params,
@ahomu
ahomu / gist:833422
Created February 18, 2011 08:42
Google Readerで胡散臭いタイトルのエントリをどうこうしたいぞ的な
// ==UserScript==
// @name Trash Hotentry
// @namespace http://havelog.ayumusato.com/
// @description くずかごフィルター
// @include http://www.google.com/reader/view*
// @version 0.1
// ==/UserScript==
(function(doc) {
setInterval(function() {
@ahomu
ahomu / KyonenNoOmoide.html
Created March 10, 2011 09:58
[a-blog cms] (去年|むかし)のおもいでモジュール
テンプレートはこんなかんじで
<!-- BEGIN_MODULE Sample_KyonenNoOmoide -->
<p>去年のおもいで</p>
<ul><!-- BEGIN omoide:loop -->
<li><a href="{url}">{title}</a></li><!-- END omoide:loop --><!-- BEGIN notFound -->
<li>おもいでなかった・・・</li><!-- END notFound -->
</ul>
<!-- END_MODULE Sample_KyonenNoOmoide -->
@ahomu
ahomu / gist:863857
Created March 10, 2011 10:03
指定リビジョン以降に変更のあったファイルを抽出するぞ
#!/usr/bin/ruby -Ku
require 'fileutils'
# つかいかた
if ARGV.length == 0
print "[Usage?] % git_diff_export [from revesion] [export dirpath]\n"
exit(false)
end
@ahomu
ahomu / gist:863904
Created March 10, 2011 10:35
[a-blog cms] loadEntryFieldとbuildFieldメソッドのつかいかた
<?php
/*
loadEntryField関数は,カスタムフィールドをFieldオブジェクトとして返します
buildFieldメソッドは,Fieldオブジェクトを自動で展開します
これで展開すると,<!-- BEGIN key:touch -->のようなブロックや,
{selected:key#var}みたいな変数が自動でループ内につくれます.
*/
@ahomu
ahomu / gist:873716
Created March 17, 2011 01:53
[a-blog cms] @tatsunori2989 さんリクエスト:フォームモジュールの特定フォームIDの投稿数を表示する
<!-- BEGIN_MODULE Sample_FormCount -->
{count}
<!-- END_MODULE Sample_FormCount-->
@ahomu
ahomu / gist:877105
Created March 19, 2011 01:00
わくわくjQuery編
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>わくわくjQuery編</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script >
<script type="text/javascript">
$(function()
{
// ★ 画像の読み込みをテキトーに待つよ
@ahomu
ahomu / ACMS_GET_User_Messanger.php
Created March 23, 2011 03:27
[a-blog cms] 登録ユーザーにメールを一斉配信できたりするかもしれない一式
<?php
require_once ACMS_LIB_DIR.'GET.php';
class ACMS_GET_User_Messanger extends ACMS_GET
{
function get()
{
if ( !sessionWithAdministration() ) die;
@ahomu
ahomu / client.js
Created April 17, 2011 15:07
nodeでTwitterのUser Streamを取得して,scoket.ioを通してwebkitNotificationsに渡す
uu.ready(function() {
var socket, notify, enable;
// デスクトップ通知をサポートしているかを判定しておく
if ( window.webkitNotifications ) {
notify = true;
uu("#detect").add('<p>READY: your browser is supported webkitNotifications.</p>');
} else {
notify = false;
uu("#detect").add('<p>ERROR: your browser does not support webkitNotifications.</p>');