View sample.html
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>sample html</title> | |
</head> | |
<body> | |
<form id="hoge"> | |
<fieldset> | |
<legend>test form</legend> |
View RomaNumber
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
#include <stdio.h> | |
#include <string.h> | |
#define NUM_LEN (100) | |
int main(void) | |
{ | |
int i; | |
int count; | |
char num[NUM_LEN]; |
View SocketServerRedis.coffee
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
module.exports = (SessionConfig, app, express) -> | |
sio = require "socket.io" | |
# Session Class | |
Session = express.session.Session | |
# sessionStore | |
# new RedisStore() | |
sessionStore = SessionConfig.getSessionStore().store |
View setupAssetMovieContents.swift
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
func setupAssetMovieContents() { | |
let file = NSURL(string: "assets-library:// ~ hogehuga ~ ") | |
let assetLibrary = ALAssetsLibrary() | |
assetLibrary.assetForURL( | |
file | |
, resultBlock: { | |
(asset: ALAsset!) in | |
if asset != nil { | |
let rep: ALAssetRepresentation = asset.defaultRepresentation() | |
View rand.c
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int num; | |
char c; | |
printf("乱数の範囲を指定して下さい:"); | |
scanf("%d", &num); |
View mongoose-group
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 mongoose = require("mongoose"); | |
var DBName = ""; | |
M.prototype.connection = mongoose.createConnection("mongodb://127.0.0.1/" + DBName, callback); | |
var database = M.connection.db | |
var collection = database.collection("datas"); | |
// keys (object), condition (object), initial (object), reduce (function), finalize (function), [options] (object), callback | |
collection.group({"id":true}, null, {}, function (curr, result) { | |
result._id = curr._id; |
View Ownd.coffee
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
https = require 'https' | |
async = require 'async' | |
global = { | |
url: 'https://api.amebaowndme.com/v2/public/blogPosts?limit=200&page=&siteId=11014&sortType=recent' | |
} | |
requestURL = (callback) => | |
req = https.get global.url, (res) -> | |
@res = "" |
View sample-cluster.conf
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
# クライアントからは以下のようにして接続 | |
# nats://user:password@localhost:4242 | |
port: 4242 | |
authorization { | |
user: user | |
password: password | |
} | |
# クラスタの設定 | |
cluster { |
View setup-nginx.sh
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
# Install | |
sudo touch /etc/yum.repos.d/nginx.repo | |
sudo sh -c "cat << 'EOF' > /etc/yum.repos.d/nginx.repo | |
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ | |
gpgcheck=0 | |
enabled=1 | |
EOF" | |
sudo yum update -y |
View app.coffee
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
### ------- Module dependencies. ------ ### | |
# Webアプリの立ち上げに必要なモジュール | |
express = require 'express' | |
cluster = require 'cluster' | |
app = express() | |
### ------- Class. -------------------- ### | |
class AppConfig | |
setViewEngine : (app, express) -> | |
app.engine(@template_name, @template) |
OlderNewer