Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
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
| .hll { background-color: #ffffcc } | |
| .c { color: #586E75 } /* Comment */ | |
| .err { color: #93A1A1 } /* Error */ | |
| .g { color: #93A1A1 } /* Generic */ | |
| .k { color: #859900 } /* Keyword */ | |
| .l { color: #93A1A1 } /* Literal */ | |
| .n { color: #93A1A1 } /* Name */ | |
| .o { color: #859900 } /* Operator */ | |
| .x { color: #CB4B16 } /* Other */ | |
| .p { color: #93A1A1 } /* Punctuation */ |
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
| authors: | |
| hanzou: | |
| name: Hanzou Hattori | |
| display_name: Hanzou | |
| gravatar: c66919cb194f96c696c1da0c47354a6a | |
| email: hanzou@company.com | |
| web: http://company.com | |
| twitter: company | |
| github: hhattori | |
| jorgen: |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
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 watch_variables(var_list): | |
| """Usage: @watch_variables(['myvar1', 'myvar2'])""" | |
| def _decorator(cls): | |
| def _setattr(self, name, value): | |
| if name in var_list: | |
| import traceback | |
| import sys | |
| # Print stack (without this __setattr__ call) | |
| traceback.print_stack(sys._getframe(1)) | |
| print '%s -> %s = %s' % (repr(self), name, value) |
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/python | |
| # | |
| # Jordan Scales (http://jordanscales.com) | |
| # 5/1/13 | |
| # | |
| # A walkthrough of a simple (but useful!) use of decorators to memoize functions | |
| def memoize(f): | |
| if not hasattr(f, 'cache'): # define a `cache` property on our function | |
| f.cache = {} # if we haven't already |
Squid configuration:
http_port 3128
https_port 3129 cert=/usr/local/opt/squid/etc/ssl/squid.crt key=/usr/local/opt/squid/etc/ssl/squid.key
Test names:
The 'http_port' annotation indicates whether Squid HTTP port was used.
The 'https_port' annotation indicates whether Squid HTTPS port was used.
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
| etamax_cassette = pytest.mark.betamax_cassette | |
| class TestGitHubAPI: | |
| def test_user(self, session, vcr): | |
| vcr.use_cassette('user') | |
| resp = session.get('https://api.github.com/user', | |
| auth=('user', 'pass')) | |
| assert resp.json()['login'] is not None |
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 'mechanize' | |
| name = ARGV[0] # Email or Card Number | |
| pass = ARGV[1] # Password | |
| agent = Mechanize.new | |
| login = agent.get 'http://colectivocoffee.com/loyalty/member-login/' | |
| form = login.forms.first | |
| form.email_number = name |
This configuration is no longer updated
OlderNewer