- Smarter completion. A few examples:
- context sensitive -- if you have file "name1" and directory "name2", "cd nam<TAB>" completes to "name2/"
- "tar xf <TAB>" completes to tarballs only. "unrar x <TAB>" completes to RARs only. etc.
- rsync / scp completion: "rsync host:anything/<TAB>" shows you files on host under anything/
- also works with rsync:// URLs
- SSH host completion from ~/.ssh/config & ~/.ssh/known_hosts
- lots of other smart completions: Rake tasks, git commands & SHAs, dpkg packages, dash-options for most commands, etc etc.
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
| # -*- encoding: utf-8 -*- | |
| from __future__ import unicode_literals | |
| import requests | |
| from requests_oauthlib import OAuth1 | |
| from urlparse import parse_qs | |
| REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token" | |
| AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token=" | |
| ACCESS_TOKEN_URL = "https://api.twitter.com/oauth/access_token" |
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 os | |
| from flask import Flask, render_template, request | |
| import stripe | |
| stripe_keys = { | |
| 'secret_key': os.environ['SECRET_KEY'], | |
| 'publishable_key': os.environ['PUBLISHABLE_KEY'] | |
| } | |
| stripe.api_key = stripe_keys['secret_key'] |
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 kata(digits = [], has_pair = false) | |
| if digits.inject {|sum, digit| sum + digit } == 15 | |
| has_pair ? [digits] : [] | |
| else | |
| start = (digits.last || 0) + 1 | |
| (start..9).inject([]) do |result, digit| | |
| result + kata(digits + [digit], has_pair) + kata(digits + [digit, digit], true) | |
| end | |
| end | |
| end |
NewerOlder