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
| module MyApp | |
| module AWS | |
| class SNS | |
| def self.stub_configuration | |
| AWS::Core::Configuration.new( | |
| access_key_id: 'ACCESS_KEY_ID', | |
| secret_access_key: 'SECRET_ACCESS_KEY', | |
| stub_requests: true, | |
| ) |
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
| user = { | |
| id: 1, | |
| name: 'ainame', | |
| } | |
| if flag | |
| user[:gender] = 'male', # ← 末尾にカンマが入ってしまっていたけどシンタックスエラーにはならない | |
| user[:age] = 100 | |
| end |
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
| gem 'arproxy' | |
| gem 'explain_parser' |
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/XCTest.h> | |
| #import <TKRGuard.h> | |
| #import <OHHTTPStubs.h> | |
| @interface AMEHTTPRequestTestCase : XCTestCase | |
| @property (nonatomic, strong) NSURLRequest *lastRequest; | |
| - (void)stubAllRequestWithResponseFileName:(NSString *)responseFileName statuCode:(NSInteger)statusCode; |
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
| use strict; | |
| use warnigns; | |
| use Test::More; | |
| use Test::More::Hooks; | |
| package Foo { | |
| sub new{ bless { counter => $_[1] }, $_[0]; } | |
| sub count_up { shift->{counter} += shift; } | |
| }; |
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
| (defun func1 (func) | |
| (funcall func)) | |
| (defun func2 (func) | |
| (func1 | |
| (lambda () | |
| (funcall func)))) | |
| (func2 | |
| (lambda () |
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
| (defun func1 (func) | |
| (funcall func)) | |
| (defun func2 (func) | |
| (func1 | |
| (lambda () | |
| (funcall func)))) | |
| (func2 | |
| (lambda () |
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 'cl-lib) | |
| (defvar newline-or-open-line/open-line-count 0) | |
| (make-variable-buffer-local 'newline-or-open-line/open-line-count) | |
| (defun newline-or-open-line/increment-open-line () | |
| (setq newline-or-open-line/open-line-count (+ newline-or-open-line/open-line-count 1))) | |
| (defun newline-or-open-line/clear-open-line-count () | |
| (setq newline-or-open-line/open-line-count 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
| (require 'cl-lib) | |
| (defvar newline-or-open-line/open-line-count nil) | |
| (make-variable-buffer-local 'newline-or-open-line/open-line-count) | |
| (defun newline-or-open-line/increment-open-line () | |
| (push 'open-line newline-or-open-line/open-line-count)) | |
| (defun newline-or-open-line/clear-open-line-count () | |
| (progn |
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
| (defun newline-or-open-line () | |
| "newline-or-openline is a new command for merging C-m and C-o" | |
| (interactive) | |
| (let ((string-exists-before-cursor (string-match "[^\\\s\\\n\\\t]" (buffer-substring (point-at-bol) (point)))) | |
| (string-exists-after-cursor (string-match "[^\\\s\\\n\\\t]" (buffer-substring (point) (point-at-eol))))) | |
| (cond ((or (eolp) | |
| (not string-exists-after-cursor) | |
| (and string-exists-before-cursor string-exists-after-cursor)) | |
| (progn (newline) (indent-according-to-mode))) | |
| (t (progn (open-line 1) (indent-according-to-mode)))))) |