Skip to content

Instantly share code, notes, and snippets.

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: Requires https://github.com/skarab/pika/tree/rabbitmq-ext
# for RabbitMQ exchange binding extensions
import csv
import getopt
import os
import random
import sys
import time
<?php
class Asset_Instance extends Fuel\Core\Asset_Instance {}
class Cache_Handler_Json extends Fuel\Core\Cache_Handler_Json {}
class Cache_Handler_Serialized extends Fuel\Core\Cache_Handler_Serialized {}
class Cache_Handler_String extends Fuel\Core\Cache_Handler_String {}
class Cache_Storage_Apc extends Fuel\Core\Cache_Storage_Apc {}
abstract class Cache_Storage_Driver extends Fuel\Core\Cache_Storage_Driver {}
class Cache_Storage_File extends Fuel\Core\Cache_Storage_File {}
class Cache_Storage_Memcached extends Fuel\Core\Cache_Storage_Memcached {}

PhpStorm + FuelPHPの設定メモ

FuelPHPはほとんど関係ない内容になっていきそうです...

PHPUnitの設定例(Macで確認)

  1. PhpStorm > Preferences > PHP で"Interpreter"を正しく設定、"OK"を押下
  2. Run > Edit Configurations...と進む
  3. 左上の"+"ボタンを押下、"PHPUnit"を選択
  4. "Name"に任意の名前を入力
var db = openDatabase("example_db", "", "Example Database", 100000);
// openDatabase(db name, required version (blank string for n/a), human-readable database name, expected size in bytes)
db.changeVersion("", "1", function(t){
t.executeSql("create table ...");
});
/* Note:
openDatabase actually takes one more (optional) argument -- a callback in case the database was /just/ created, for you to call changeVersion and provide an initial schema. However, since this post is more interested in migrations, and because I don't want the initial migration to be a "special case", I'm pretending like it doesn't exist. It's there if you want it, of course.
*/
public class RedisClient {
private JedisPool pool;
@Inject
public RedisClient(Settings settings) {
try {
pool = new JedisPool(new JedisPoolConfig(), settings.get("redis.host"), settings.getAsInt("redis.port", 6379));
} catch (SettingsException e) {
// ignore

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?
@ryu1
ryu1 / README.md
Last active August 29, 2015 14:01

Project

Description: What does this project do and who does it serve?_

Requirements

Project Setup

How do I, as a developer, start working on the project?

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@ryu1
ryu1 / Java_Tips_And_Tricks.md
Last active February 14, 2020 09:29
Java Tips And Tricks
trueかfalseをランダムで返す
new java.util.Random().nextBoolean()
Math.random() < 0.5
AOPでくるまれたオブジェクトをUNWRAPする.