MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。
2014年6月11日時点での情報。
- Version: CoreOS 343.0.0
- Kernel: 3.14.5
- Docker: 1.0
<?php | |
/* | |
Plugin Name: Hardcode theme switcher | |
Plugin URI: http://ja.forums.wordpress.org/topic/13483 | |
Author: Takuro Hishikawa | |
Version: 0.1 | |
*/ | |
function my_theme_switcher($theme){ | |
// yes, it's hardcoded! |
import uuid | |
import wtforms_json | |
from sqlalchemy import not_ | |
from sqlalchemy.dialects.postgresql import UUID | |
from wtforms import Form | |
from wtforms.fields import FormField, FieldList | |
from wtforms.validators import Length | |
from flask import current_app as app | |
from flask import request, json, jsonify, abort |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "VPC knowhow template", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type": "String", | |
"MinLength": "1", | |
"MaxLength": "64", | |
"AllowedPattern": "[-_ a-zA-Z0-9]*", |
import Foundation | |
// Tuple result | |
// Get contents of directory at specified path, returning (filenames, nil) or (nil, error) | |
func contentsOfDirectoryAtPath(path: String) -> (filenames: String[]?, error: NSError?) { | |
var error: NSError? = nil | |
let fileManager = NSFileManager.defaultManager() | |
let contents = fileManager.contentsOfDirectoryAtPath(path, error: &error) |
Alamofire is a great Swift library developed by the creator of AFNetworking @mattt. The purpose of this gist is to explain how to use the built-in power of Alamofire to serialize your JSON. In this example we will be serializing a simple blog API. First we will start with serializing a single JSON object and add complexity as we go along.
This is the first JSON object that we will be serializing.