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
| require 'active_record' | |
| require 'logger' | |
| task :default => 'db:migrate' | |
| namespace :db do | |
| MIGRATIONS_DIR = "db/migrate" | |
| desc "Migrate the database" | |
| task :migrate => :environment 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
| <?xml version="1.0"?> | |
| <root> | |
| <list> | |
| <item> | |
| <name>LeaveInsMode with EISUU(Terminal)</name> | |
| <identifier>private.app_terminal_esc_with_eisuu</identifier> | |
| <only>TERMINAL</only> | |
| <autogen>--KeyToKey-- KeyCode::ESCAPE, KeyCode::ESCAPE, KeyCode::JIS_EISUU</autogen> | |
| <autogen>--KeyToKey-- KeyCode::C, VK_CONTROL, KeyCode::C, VK_CONTROL, KeyCode::JIS_EISUU</autogen> | |
| <autogen>--KeyToKey-- KeyCode::BRACKET_LEFT, VK_CONTROL, KeyCode::ESCAPE, KeyCode::JIS_EISUU</autogen> |
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
| import XCTest | |
| import CoreData | |
| class CoreDataTest: XCTestCase { | |
| var managedObjectContext: NSManagedObjectContext? | |
| override func setUp() { | |
| super.setUp() | |
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
| ' 指定したフォルダ直下のファイルのパスの一覧を文字列の配列として取得する | |
| ' 引数 | |
| ' folderPath: 対象フォルダ | |
| ' fileFilter: ファイルを絞りこむためのフィルタ、初期値は"*"(全てのファイル) | |
| ' 例) "*.xls*" エクセルファイル | |
| ' ファイルが存在しない場合、空の配列を返す ※空の配列はUBoundで-1を返す | |
| Private Function GetFilePathArrayFromTargetFolder(folderPath As String, _ | |
| Optional fileFilter As String = "*") As String() | |
| Dim filePathArray() As String | |
| Dim fileName As String |
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
| ' 文字列を文字の配列に分割する | |
| Private Function SplitStringToArrayOfChar(str As String) As String() | |
| Dim buff() As String | |
| Dim i As Integer | |
| ReDim buff(Len(str) - 1) | |
| For i = 1 To Len(str) | |
| buff(i - 1) = Mid$(str, i, 1) | |
| Next i |
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
| ' 指定したフォルダ直下のファイルのパスの一覧を文字列のコレクションとして取得する | |
| ' 引数 | |
| ' folderPath: 対象フォルダ | |
| ' fileFilter: ファイルの絞り込み文字列 例) "*.xls*"(エクセルファイル) | |
| Private Function GetFilePathCollectionFromTargetFolder(folderPath As String, Optional fileFilter As String = "*") As Collection | |
| Dim filePathCollection As Collection | |
| Dim fileName As String | |
| Dim filePath As String | |
| Set filePathCollection = New Collection |
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
| counter = function() { | |
| var count = 0; | |
| return function() { | |
| return count += 1; | |
| } | |
| } | |
| c1 = counter() | |
| c1() //=> 1 | |
| c1() //=> 2 |
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
| /(0|-?[1-9]\d*)/ |
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
| ' 指定のセルの位置に画像ファイルのイメージを等倍で貼り付ける | |
| Private Sub PasteImageFromFile(targetRange As Range, imageFilePath As String) | |
| Dim image As Shape | |
| Dim startingSheet As Worksheet | |
| ' 処理開始前のシートを記録する | |
| Set startingSheet = ActiveSheet | |
| targetRange.Worksheet.Activate | |
| targetRange.Select |
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
| Dir.glob("**/*.txt").each do |t| | |
| src = File.expand_path(t) | |
| dist = src.gsub(/txt$/, "md") | |
| cmd = "git mv #{src} #{dist}" | |
| puts "Execute '#{cmd}'" | |
| `#{cmd}` | |
| end |
OlderNewer