JavaScript Patterns

Object-Oriented

Only five primitive types are not objects: number, string, boolean, null, and undefined
Functions are objects, too. They can have properties and methods.
Variable automatically becomes a property of an internal obejct known as an Activation Object
This variable is actually also object-like because it has its own properties.
An object is just a collection of named properties, a list of key-value pairs. (almost identical to an associative array in other languages)
Some of the properties could be functions, in which case we call them methods.
There are two types of objects.
Native : Described in the ECMAScript standard
Host : Defined by the host environment (Ex: browser environment)

No Class in JavaScript

There are no classes in JavaScript.
You don’t need to have a class to create an object.
You create a blank object when you need one and then start adding interesting members to it.
You compose objects by adding primitivese, functions, or other objects to them as their properties.
JavaScript odes have inheritance

Maintainable code

is readable
is consistent
is predictable
looks as if it was written by the same person
is documented

Drupal7 NodequenueをViewに追加

ViewでNodequenueをSortCriteriaに追加するためには、ViewにおいてRelationshipsを構築する必要が有る。

先にRelationshipsでNodequenueを追加すると、Sort CriteriaにもNodequenueが表示される。

Drupal7 preprocess functions kpr($hook)

WordPressのようにレンダー前にフックをかける時にはtemplate.phpにpreprocessファンクションを作成する。

function themename_preprocess($variables, $hook) {
kpr($hook);
}

でどのようなフックが使われているか確認できる。

Flask

Flask のデフォルトフォントdinは_button.placeholder.scssで複数箇所で使われているため変更すること。

Drupal7 Sprout Content add ページ

Sproutで設定されているUIのContent add ページではオプションメニューを下に表示される代わりにPanelでUIが設定されている

Sprout profile

Drupal variable

When you want to inspect what variables are available, 

put a code below

dpm(get_defined_vars());

dpm(get_defined_vars(), 'custom text'); outputs the custom text right above the output of variables which makes us find the part easier.

Jekyll (Markdown)

Points

Use include and loops as much as you can.
Avoid making each unique template.
To make items for an array, enter a dash on the top variable of the item.
The item without a dash means another variable of the item having a dash.
– name: Open-Minded Aficionados
foo: another variable
– name: Connected Enthusiasts
– name: Leisure Professionals
– name: Bond Builders
– name: Active Learners
– name: Satisfied Traditionalists
default.html should be the only one file having Doctype declaration.