Ctrl + a – go to the start of the command line
Ctrl + e – go to the end of the command line
Ctrl + k – delete from cursor to the end of the command line
Ctrl + u – delete from cursor to the start of the command line
Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
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
| def countLetters(str, ch): | |
| fruit = str | |
| count = 0 | |
| for char in fruit: | |
| if char == ch: | |
| count = count + 1 | |
| print count |
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
| fruit = "banana" | |
| def revFruit(fruit): | |
| index = len(fruit)-1 | |
| while index >= 0: | |
| letter = fruit[index] | |
| print letter | |
| index = index - 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
| Capybara.default_driver = :selenium # Subdomain testing will only work with pow and selenium | |
| pow_config = "#{Rails.root}/.powenv" # Dont change, this is the Config Files Location. | |
| pow_config_stash = "#{Rails.root}/.powenv_original" # This is what the config will be stashed as during testing. | |
| Before do | |
| # Set the default host | |
| Capybara.app_host = "http://assessory.dev" | |
| # Stash the existing config |
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 "open-uri" | |
| remote_base_url = | |
| "http://api.twitter.com/1/statuses/user_timeline.xml?count=100&screen_name=" | |
| twitter_user = "USAGov" | |
| remote_full_url = remote_base_url + twitter_user | |
| first_page = 1 | |
| last_page = 5 | |
| (first_page..last_page).each do |page_num| |
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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
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
| "\e[1~": beginning-of-line | |
| "\e[4~": end-of-line | |
| “\e[5~”: history-search-backward | |
| “\e[6~”: history-search-forward | |
| "\e[3~": delete-char | |
| "\e[2~": quoted-insert | |
| "\e[5C": forward-word | |
| "\e[5D": backward-word | |
| "\e\e[C": forward-word | |
| "\e\e[D": backward-word |
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
| MARKDOWN | |
| # Header 1 # | |
| ## Header 2 ## | |
| ### Header 3 ### (Hashes on right are optional) | |
| #### Header 4 #### | |
| ##### Header 5 ##### | |
| ## Markdown plus h2 with a custom ID ## {#id-goes-here} | |
| [Link back to H2](#id-goes-here) |
NewerOlder