Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
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 python | |
""" Print all of the clone-urls for a GitHub organization. | |
It requires the pygithub3 module, which you can install like this:: | |
$ sudo yum -y install python-virtualenv | |
$ mkdir scratch | |
$ cd scratch | |
$ virtualenv my-virtualenv |
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
herp = (lambda clist: __import__('wsgiref.simple_server').simple_server.make_server('0.0.0.0', 8080, clist[-1].make_wsgi_app()).serve_forever())((lambda config: [config.add_route('hello', '/hello/{name}'), config.add_view(lambda request: __import__('pyramid.response').response.Response('Hello {0}'.format(request.matchdict['name'])), route_name="hello"), config])((lambda: __import__('pyramid.config').config.Configurator())())) |
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
""" | |
This small module makes it easy to bake PNG images with links to | |
Open Badge assertions. It also allows for easy retrieval of the link | |
from baked PNGs. | |
For more information on badge baking, see: | |
https://github.com/mozilla/openbadges/wiki/Badge-Baking | |
Note that this module requires the PyPNG module: |
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 = [email protected]: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
In [1]: policy = """{ | |
...: "Statement":[{ | |
...: "Effect":"Allow", | |
...: "Action":["s3:*"], | |
...: "Resource":["arn:aws:s3:::mybucket"]}]}""" | |
In [2]: import boto | |
In [4]: c = boto.connect_iam() | |
In [5]: instance_profile = c.create_instance_profile('myinstanceprofile') | |
In [6]: role = c.create_role('myrole') | |
In [7]: c.add_role_to_instance_profile('myinstanceprofile', 'myrole') |
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 boto.ec2 | |
import os, time | |
# define region_name to be region you want to connect to | |
region_name = 'eu-west-1' | |
conn = boto.ec2.connect_to_region(region_name) | |
# First upload a public key to use for SSH'ing to instance. Use "ssh-keygen" to generate. | |
fp = open(os.path.expanduser('~/.ssh/mykey.pub')) | |
material = fp.read() |
NewerOlder