- Start at the first character of the first line collection = getCollection(); process(somethingInTheWay, target);
- Yank the word "collection" with -
yiw
- Move to the beginning of the word "somethingInTheWay" with -
jww
- Delete the word "somethingInTheWay" with -
diw
- Paste from the Yank Register with -
"0P
- Look at the Yank Register with -
:reg "0
This file contains 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
(ns keyword-like-function-test | |
(:require [clojure.test :refer :all])) | |
(defn find-values | |
[& {:keys [p1 p2] :or {p1 [0 0] p2 [1 1]}}] | |
[p1 p2]) | |
(deftest keyword-arguments-test | |
(testing "when both of the arguments were passed" | |
(is (= [4 15] (first (find-values :p1 [4 15] :p2 [3 21])))) |
This file contains 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
(ns fizzbuzz.core | |
(:gen-class)) | |
(defn- format-output [output current] | |
(cond | |
(= 0 (mod current 15)) (str output "FizzBuzz\n") | |
(= 0 (mod current 3)) (str output "Fizz\n") | |
(= 0 (mod current 5)) (str output "Buzz\n") | |
:else (str output current "\n"))) |
- type in the word: "errors for job profile"
- move to the first 'p'
- select the entire content within the quotes:
vi"
- select just from the cursor to the quotes:
vt"
- delete just from the cursor location to the quote:
dt"
- delete everything within the quotes:
di"
- open a file with a few hundred lines of code
This file contains 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 Services | |
class LoadsPositionTypes | |
extend ::Services::LookupDataFetchable | |
def self.entity_class | |
PositionType | |
end | |
end | |
end |
This file contains 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 Enumerable | |
def bubble_sortit | |
reached_end = true | |
(1..self.length-1).each do |e| | |
if self[e] < self[e-1] | |
self[e-1], self[e] = self[e], self[e-1] | |
reached_end = false | |
end | |
end |
This file contains 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
When /^I am on the Billing\/Shipping address page$/ do | |
# setting the order_id to 1 in the session | |
class Spree::BaseController < ApplicationController | |
prepend_before_filter :stub_order_id_in_session | |
def stub_order_id_in_session | |
session[:order_id] = 1 | |
end | |
end |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<!-- | |
Created using / | |
Source can be edited via /anakul/8/edit | |
--> | |
<head> |
This file contains 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
#!/bin/bash | |
function create_dir { | |
if [ ! -d $1 ]; | |
then | |
mkdir $1 | |
fi | |
} | |
echo "create the src directory..." |
This file contains 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
should = require 'should' | |
House = { | |
leave: (dude) -> | |
'leaves the house' | |
closeTheDoor: (dude) -> | |
'closes the door' | |
} | |
Car = { | |
jumpIn: (dude) -> |