This file contains hidden or 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
describe 'Post #create' do | |
context '有効なパラメータの場合' do | |
let(:create_user) { -> { post :create, user: attributes_for(:user) }} | |
it 'リクエストは302 リダイレクトとなること' do | |
create_user | |
expect(response.status).to eq 302 | |
end | |
it 'データベースに新しいユーザーが登録されること' do |
This file contains hidden or 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.Text; | |
namespace System.Diagnostics { | |
/// <summary> | |
/// 時間計測クラス(適当) | |
/// </summary> | |
public class TimeLogger : IDisposable { | |
private static int CommonOffset = 0; |
This file contains hidden or 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 UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Callbacks; | |
using UnityEditor.iOS.Xcode; | |
using System.Collections; | |
using System.IO; | |
public class PostBuildProcess | |
{ | |
internal static void CopyAndReplaceDirectory (string srcPath, string dstPath) |
This file contains hidden or 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 UnityEngine; | |
using UnityEditor; | |
using UnityEditor.AnimatedValues; | |
using UnityEngine.Events; | |
public class HelloWorldEditorWindow : EditorWindow | |
{ | |
[MenuItem("Window/HelloWorld")] | |
static void Open () |
This file contains hidden or 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 UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
public class HelloWorldEditorWindow : EditorWindow | |
{ | |
[MenuItem("Window/HelloWorld")] | |
static void Open () | |
{ |
This file contains hidden or 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 offset = 5;//Top,Right,Bottom,Left expand 5px. | |
var doc = app.activeDocument; | |
var abs = doc.artboards; | |
for(var i=0;i<abs.length;i++){ | |
var a = abs[i]; | |
var rect = a.artboardRect; | |
rect[0]=rect[0]-offset; | |
rect[1]=rect[1]+offset; |
This file contains hidden or 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 (Stream file = File.Create(dllFullPath)) { | |
CopyStream(stream, file); | |
} | |
public static void CopyStream(Stream input, Stream output) { | |
byte[] buffer = new byte[8 * 1024]; | |
int len; | |
while ((len = input.Read(buffer, 0, buffer.Length)) > 0) { |
This file contains hidden or 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
/// <summary> | |
/// 埋め込まれたリソースから取得 | |
/// </summary> | |
/// <param name="name">name</param> | |
/// <returns></returns> | |
public static Stream GetAssemblyStream(string name) { | |
Assembly asm = Assembly.GetExecutingAssembly(); | |
string filename = asm.GetManifestResourceNames() | |
.ToList() |
This file contains hidden or 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 <iostream> | |
#include <cmath> | |
using namespace std; | |
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_A | |
class Dice{ | |
int n[6]; | |
public: |
This file contains hidden or 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
Option Explicit | |
'スライドタイトルが他のスライドに[タイトル]という文字列で見つかった場合、 | |
'テキストからスライドへのハイパーリンクを設定する | |
' | |
'パワーポイントで図表入りの用語集みたいなもの(1ページ1要素)を作っていて、 | |
'説明文中に他用語へのリンクを貼りたかったので作った。 | |
' | |
' 前提:スライドマスタにタイトルプレースホルダーがあること。 | |
' |