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
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
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
| ;;; json-reformat --- Reformat tool for JSON | |
| ;; Author: Wataru MIYAGUNI <[email protected]> | |
| ;; Keywords: json | |
| ;; Copyright (c) 2012 Wataru MIYAGUNI | |
| ;; | |
| ;; MIT License | |
| ;; | |
| ;; Permission is hereby granted, free of charge, to any person obtaining |
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
| (global-git-gutter-mode t) | |
| (global-set-key (kbd "C-c C-g") 'git-gutter:toggle) | |
| (global-set-key (kbd "C-c v =") 'git-gutter:popup-diff) | |
| ;; Jump to next/previous hunk | |
| (global-set-key (kbd "C-c p") 'git-gutter:previous-hunk) | |
| (global-set-key (kbd "C-c n") 'git-gutter:next-hunk) | |
| ;; Revert current hunk |
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 'find-file-in-git-repo) | |
| (defadvice find-file-in-git-repo (around find-file-in-git-repo-around) | |
| "Always look in ulc" | |
| (let ((default-directory "/usr/local/cpanel/")) | |
| ad-do-it)) | |
| (ad-activate 'find-file-in-git-repo) | |
| (defalias 'find-file-in-git-repo 'ffg) |
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
| ;; C-h f edmacro-mode | |
| ;; What if you want to assign special key combination only for some specific mode? You'll generally have to know the name of ;; the key map variable for this mode: | |
| (define-key occur-mode-map "n" 'occur-next) |
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
| C-x @ S event-apply-shift-modifier | |
| C-x @ a event-apply-alt-modifier | |
| C-x @ c event-apply-control-modifier | |
| C-x @ h event-apply-hyper-modifier | |
| C-x @ m event-apply-meta-modifier | |
| C-x @ s event-apply-super-modifier |
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 'rspec' | |
| require 'ap' | |
| FILE = <<EOF | |
| 10.1.4.4 165.91.182.7 | |
| 10.1.4.5 165.91.182.7 | |
| 10.1.4.6 165.91.182.8 | |
| 165.91.187.3 165.91.187.3 | |
| 192.168.1.3 | |
| 10.0.0.5 10.0.0.1 |
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
| class CircularList < Array | |
| def index | |
| @index ||=0 | |
| @index.abs | |
| end | |
| def current | |
| @index ||= 0 | |
| get_at(@index) | |
| 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
| (defun dired-back-to-top () | |
| (interactive) | |
| (beginning-of-buffer) | |
| (dired-next-line 4)) | |
| (define-key dired-mode-map | |
| (vector 'remap 'beginning-of-buffer) 'dired-back-to-top) | |
| (defun dired-jump-to-bottom () | |
| (interactive) |
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
| (defadvice executable-make-buffer-file-executable-if-script-p (around executable-make-buffer-file-executable-if-script-p-around) | |
| "Tests should not be executable." | |
| (unless (string= ".t" (file-name-extension (buffer-name) t)) | |
| ad-do-it)) | |
| (ad-activate 'executable-make-buffer-file-executable-if-script-p) |