This file contains 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 flask import Flask, make_response, request, render_template | |
import json | |
import uuid | |
app = Flask(__name__) | |
app.order_identity = 0 | |
orders = [] | |
class Order(object): |
This file contains 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
- name: Mount code folder. | |
mount: fstype=vboxsf name=${project_root}/code/ src=${project_name} state=mounted | |
only_if: "$vm == 1" |
This file contains 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
function main3(scope) { | |
return function (data) { | |
scope.log(data.length); | |
}; | |
} | |
function main2(scope) { | |
return function (data) { | |
var innerPromise = $.get("http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"); | |
innerPromise.then(main3(scope)); |
This file contains 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
hdoc 'clobber_all', 'clobber and remove package files' | |
task :clobber_all => [:clobber] do | |
PackageBuilder.new.clean | |
end | |
hdoc 'build_deb_package', 'build a debian packages' | |
task :build_deb_package => [:compress] do | |
builder = `which dpkg-deb`.chomp | |
PackageBuilder.new.prepare | |
if builder.include? "dpkg-deb" |
This file contains 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
- name: Local connection for AWS magic | |
hosts: 127.0.0.1 | |
connection: local | |
gather_facts: False | |
tasks: | |
local_action: | |
module: ec2 | |
region: us-east-1 | |
keypair: blitz-shared | |
group: "{{ sg_ssh_http_open }}" |
This file contains 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
- name: Find Type=scalr | |
hosts: | |
- tag_Type_scalr | |
connection: local | |
gather_facts: False | |
tasks: | |
- ec2_facts: | |
- name: Add new instance to scalr hostgroup |
This file contains 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
universal_server() -> | |
receive | |
{become, F} -> | |
F() | |
end. |
This file contains 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
Java: | |
public List<Item> bought(User user) | |
{ | |
List<Item> result = new ArrayList(); | |
for (Item item : currentItems) | |
{ | |
if (user.bought(item)) | |
{ | |
result.add(item); |
This file contains 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
cmd_builder = ["ansible-playbook"] | |
has_region = partial(_cond, region) | |
coerce_region = partial(_dnoc, region, None) | |
region_id = coerce_region(regions.get(region)) | |
extra_vars = coerce_region("--extra-vars \"region={} region_name={}\"".format(region_id, region)) | |
key = _cond(ssh_key, ssh_key, _cond(region, "blitz-shared.id_rsa", None)) | |
private_key_file = _cond(key, "--private-key={}".format(key), None) | |
inventory = has_region("ec2.py", "devops/development") | |
debug = _cond(debug, "-vvvv", None) |
This file contains 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
# via | |
# http://wiki.apache.org/couchdb/Installing_on_Ubuntu | |
cd /tmp | |
wget http://mirror.netcologne.de/apache.org/couchdb/source/1.4.0/apache-couchdb-1.4.0.tar.gz | |
### make sure you have a couchdb user for the daemon, and couchb group also | |
## get developer tools dependencies | |
sudo apt-get install -y g++ | |
sudo apt-get install -y erlang-dev erlang-manpages erlang-base-hipe erlang-eunit erlang-nox erlang-xmerl erlang-inets |
OlderNewer