Skip to content

Instantly share code, notes, and snippets.

View GRGSIBERIA's full-sized avatar

Eiichi Takebuchi GRGSIBERIA

View GitHub Profile
db.client.create_table(
table_name: "test",
attribute_definitions: [
{attribute_name: "name", attribute_type: "S"},
{attribute_name: "number", attribute_type: "N"}
],
key_schema: [
{attribute_name: "number", key_type: "HASH"},
{attribute_name: "name", key_type: "RANGE"}
],
$dynamodb = dynamodb_client(:tokyo)
def create(name, params)
table = nil
if params[:range] == nil
table = $dynamodb.tables.create(name, 1, 1,
hash_key: params[:hash])
else
table = $dynamodb.tables.create(name, 1, 1,
hash_key: params[:hash],
sudo su
apt-get update
apt-get install git-core rbenv ruby-build ruby-bundler
gem install bundler
apt-get upgrade
vi /root/.bashrc
# 最終行に以下を追加
# export PATH="$HOME/.rbenv/bin:$PATH"
# eval "$(rbenv init -)"
expect{@post.vote_tag(tagname: nil)}.to raise_error(ArgumentError)
# Never trust parameters from the scary internet, only allow the white list through.
def post_params
params.require(:post).permit(:userid, :file_name, :file_hash)
end
@GRGSIBERIA
GRGSIBERIA / gist:9290218
Created March 1, 2014 14:07
SequelでJSONを出力したい時にはさむもの
# SequelでJSON出力ができるようになる
class Sequel::Dataset
def to_json
naked.all.to_json
end
end
post '/vote/tag/create' do
tag_name = params[:tag_name]
begin
Tag.create(tag_name)
rescue ArgumentError => e
halt 400, e.message
end
#tag_name
end
@GRGSIBERIA
GRGSIBERIA / test.cs
Created April 3, 2014 14:54
MMD for UnityでVMDファイルの書き出しをする
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
using System.IO;
public class SimpleMorphing : MonoBehaviour
{
public GameObject pmx_model;
void ExportFormat()
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.StackOverflowException: The requested operation caused a stack overflow.
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
at Mono.CSharp.Block.ResolveMeta (Mono.CSharp.BlockContext ec, Int32 offset) [0x00000] in <filename unknown>:0
@GRGSIBERIA
GRGSIBERIA / test.cs
Created April 18, 2014 08:56
ネット上にあるVMDファイルをダウンロードして,表示されているモデルに適用する(表情だけ)
using UnityEngine;
using System.Collections;
public class SkinLoader : MonoBehaviour
{
public GameObject target_object;
// Use this for initialization
IEnumerator Start()
{