Skip to content

Instantly share code, notes, and snippets.

@tony-landis
tony-landis / array-to-texttable.php
Created December 3, 2008 08:00
PHP: Array to Text Table Generation Class
<?php
/**
* Array to Text Table Generation Class
*
* @author Tony Landis <tony@tonylandis.com>
* @link http://www.tonylandis.com/
* @copyright Copyright (C) 2006-2009 Tony Landis
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class ArrayToTextTable
val ahoNum = Array(
"ぜ~ろ", "い~ち", "にぃ~", "さぁ~ん",
"よぉ~ん", "ごぉ~", "ろぉ~く", "ななぁ~",
"はぁ~ち", "きゅ~ぅ", "じゅ~ぅ"
)
class NabeInt(i:Int){
def から(j:Int):List[Int] = (i to j).toList
}
@1000k
1000k / encodeco.php
Created September 1, 2011 01:32
PHP+jQuery Encoding/Decoding string form only in 1 file
<?php
if (isset($_POST['input']) && isset($_POST['mode'])) {
ob_start();
// Needs decoding because $_POST is encoded when jQuery.ajax sended the data.
$input = urldecode($_POST['input']);
switch ($_POST['mode']) {
case 'serialize':
$output = serialize($input);
@daneko
daneko / PHPUnit_vfsStream_memo.php
Created November 18, 2011 14:34
PHPUnit vfsStreamの使用方法メモ
<?php
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'vfsStream/vfsStream.php';
// require_once 'hoge.php';
/**
* ファイルシステムのテストに関してはURL参照
* とりあえずざっくり使う方法メモ
* @see http://www.phpunit.de/manual/3.6/ja/test-doubles.html#test-doubles.mocking-the-filesystem.examples.ExampleTest.php
@sime
sime / schema.php
Created February 26, 2012 15:01
Possible example of using the CakePHP Schema callback `after` to insert content in the database
<?php
// Possible example of using the CakePHP Schema callback `after`
// to insert content in the database.
// Inspiration: https://github.com/majna/schema
// Copy schema.php to app/Config/Schema
// Run: ./Console/cake schema create
App::uses('ClassRegistry', 'Utility');
class AppSchema extends CakeSchema {
@matope
matope / NoSQLデータモデリング技法.markdown
Created April 16, 2012 03:35
NoSQLデータモデリング技法

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@jippi
jippi / build.xml
Created May 12, 2012 18:33
Ant / Jenkins / CakePHP build file
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build-parallel">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
@1000k
1000k / array-to-texttable.php
Created July 10, 2012 02:34 — forked from tony-landis/array-to-texttable.php
PHP: Array to Text Table Generation Class
<?php
/**
* Array to Text Table Generation Class
*
* @author Tony Landis <tony@tonylandis.com>
* @link http://www.tonylandis.com/
* @copyright Copyright (C) 2006-2009 Tony Landis
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class ArrayToTextTable
@mokemokechicken
mokemokechicken / Chef.md
Created November 9, 2012 05:45
Chef勉強会下書き

Chefとは

  • インフラ・ミドルウェア・アプリケーション構成の設定・管理フレームワーク
  • CUIコマンドベースでなく、Rubyベースで記述する
  • 一度書けば、誰でも実行できたり、再利用できるのが嬉しい
  • 類似フレームワークとしては、Puppetが有名

Chefのメリット

@ponkore
ponkore / clojure-reader-macro.md
Created December 3, 2012 15:32
Clojure のリーダーマクロについて (lisp reader macro advent calendar 2012 の記事です)。

Clojure のリーダーマクロについて

この記事は、lispリーダーマクロアドベントカレンダー の4日目の記事です。 タイトルにある通り、Clojure でのリー ダーマクロについて取り扱います(対象とする Clojure のバージョンは 1.4)。

はじめに