This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Harry Potter and the Philosopher's Stone", | |
"author": "J.K. Rowling", | |
"hoge": { | |
"stringField": "piyo", | |
"numField": 123, | |
"floatField": 20.315, | |
"boolField": false, | |
"huga": { | |
"piyo": ["orange","apple"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ルートノード | |
var root_node = new json_sample.RootObject(); | |
root_node.title = "Harry Potter and the Philosopher's Stone"; | |
root_node.author = "J.K. Rowling"; | |
root_node.tags = new List<string> { "novel", "story", "magic" }; | |
root_node.valiableTags = new List<object> { 123, false, "str" }; | |
root_node.intArray = new List<int> { 1, 2, 3, 4, 5 }; | |
root_node.floatArray = new List<double> { 1.2, 1.3, 1.4, 2.0 }; | |
root_node.date = "2016/11/29T12:34:56.000"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace json_sample | |
{ | |
namespace JsonNodeHoge | |
{ | |
public class Huga | |
{ | |
public List<string> piyo { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
using RazorEngine; | |
using System.IO; | |
using RazorEngine.Configuration; | |
using RazorEngine.Text; | |
using RazorEngine.Templating; | |
namespace template_sample | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//一時ディレクトリ作成 | |
string temp_path = Path.GetTempPath(); | |
string temp_dir_name = Path.GetRandomFileName(); | |
string temp_dir = Path.Combine(temp_path, temp_dir_name); | |
try | |
{ | |
if (Directory.Exists(Path.Combine(temp_path, temp_dir_name))) | |
{ | |
Directory.Delete(temp_dir, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use 'ruby clone-github.rb' | |
# ユーザー名とかdepthオプションは自分で書き換えてください。 | |
require "json" | |
require "open-uri" | |
response = open("https://api.github.com/users/Hiroto-K/repos?per_page=100").read | |
JSON.parse(response).each do |info| | |
clone_url = info["ssh_url"] | |
to = info["name"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "aws.phar"; | |
//設定 | |
$access_key = "<ACCESS_KEY>"; | |
$secret_key = "<SECRET_KEY>"; | |
$distribution_id = "<DISTRIBUTION_ID>"; | |
$paths = array("/img/a.png",); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RTX1200 Rev.10.01.65 (Tue Oct 13 12:23:48 2015) | |
# Memory 128Mbytes, 3LAN, 1BRI | |
# main: RTX1200 ver=b0 serial=XXXXXXXX MAC-Address=XX:XX:XX:XX:XX:XX MAC-Address=XX:XX:XX:XX:XX:XX MAC-Address=XX:XX:XX:XX:XX:XX | |
# Reporting Date: Aug 7 17:18:23 2016 | |
# セキュリティクラス 3(シリアルからのみログイン許可) | |
# Telnet SSHコマンド使用不可 | |
security class 3 on off off | |
# タイムゾーンはJST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Rubyで重い処理を並列動作させるサンプルスクリプトです。 | |
require 'parallel' | |
require 'pp' | |
# 開始時刻と終了時刻を記録するクラス | |
class RecordUtil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# ElasticCacheにmemcacheクラスタを構築するスクリプトです。 | |
# 要 AWS SDK for Ruby V2 | |
require 'aws-sdk-core' | |
require 'yaml' | |
require 'pp' | |
config = YAML.load(File.read('config.yml')) |