None of this is really necessary now that the Docker team is releasing official Mac OS X binary builds. Please see moby/moby#3337 for details.
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
| package com.amazon.aws.demo; | |
| import java.io.BufferedInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.PrintWriter; | |
| import java.io.StringWriter; | |
| import java.io.Writer; | |
| import java.net.URL; | |
| import java.net.URLConnection; |
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
| {# use in combination with https://github.com/zyga/django-pagination #} | |
| {# and http://twitter.github.com/bootstrap/ #} | |
| {# project-dir/templates/pagination/pagination.html #} | |
| {% if is_paginated %} | |
| {% load i18n %} | |
| <div class="pagination"> | |
| <ul> | |
| {% block previouslink %} | |
| {% if page_obj.has_previous %} |
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
| # -*- coding: utf-8 -*- | |
| from flask import Flask, request, redirect, url_for, session, abort, current_app, json | |
| app = Flask(__name__) | |
| # This is the very unsecret key from the Flask-docs | |
| app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT' | |
| @app.route('/') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| from django.conf import settings | |
| from django.utils.encoding import filepath_to_uri | |
| from storages.backends.s3boto import S3BotoStorage | |
| class StaticStorage(S3BotoStorage): | |
| location = settings.STATICFILES_LOCATION | |
| def url(self, name, headers=None, response_headers=None, expire=None): | |
| return '{}{}'.format(settings.STATIC_URL,filepath_to_uri(name)) |
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
| # Dictionaries are inherently orderless, but lists are ordered! | |
| import collections | |
| d = { '123': { 'key1': 3, 'key2': 11, 'key3': 3 }, | |
| '124': { 'key1': 6, 'key2': 56, 'key3': 6 }, | |
| '125': { 'key1': 7, 'key2': 44, 'key3': 9 } } | |
| results_list = [] | |
| sort_by_dict = {} |
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
| inotifywait -m -e moved_to $BASE | while read line | |
| do | |
| F=$(echo $line | cut -f3 -d" ") | |
| echo "Now uploading $F" | |
| s3cmd --force --no-progress put $F s3://mybucket/ & | |
| done |
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
| # For every AWS availability zone and instance I care about, check the spot | |
| # price for the last ninety days and generate stats about which spot instance | |
| # gives the best deal. | |
| import boto | |
| import boto.ec2 | |
| from vowpal_platypus.utils import mean | |
| REGIONS = {'us-east-1': ['us-east-1a', 'us-east-1b', 'us-east-1c', 'us-east-1e'], |
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 | |
| import struct | |
| def rightrotate(i, n, wsize): | |
| return ((i << (wsize-n)) & (2**wsize-1)) | (i >> n) | |
| class SHA2(object): | |
| """Abstract class for SHA-2 variants""" | |
| def __init__(self): |
OlderNewer