Put all your static files in /static directory. If you put index.html into /static, it will be served up as welcome file.
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
"""Store implementation for the openidenabled.com python library, using the GAE's memcache.""" | |
from openid.store.interface import OpenIDStore | |
from openid.store import nonce | |
import string, logging | |
import google.appengine.api.memcache | |
memcache = google.appengine.api.memcache.Client() | |
class MemcacheStore(OpenIDStore): | |
"""Implements http://openidenabled.com/files/python-openid/docs/2.2.1/openid.store.interface.OpenIDStore-class.html""" |
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 "Classic" style/top-level type of apps do something like: | |
# | |
# configure :development do | |
# require File.join(File.dirname(__FILE__), 'sinatra_reloader') | |
# set :reload_paths, [File.join(File.dirname(__FILE__), '**', '*.rb')] | |
# end | |
# | |
# For "Modular" style/Sinatra::Base subclasses: | |
# | |
# configure :development do |
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
~/$ lein new ring-on-heroku | |
Created new project in: /home/jim/Development/ring-on-heroku | |
~/$ cd ring-on-heroku | |
~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile | |
~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj | |
(ns ring-on-heroku.core | |
(:use ring.util.response | |
ring.adapter.jetty)) | |
(defn app [req] |
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
.DS_Store | |
*.swp | |
*.swo | |
Gemfile.lock |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:*" | |
], | |
"Resource": [ | |
"arn:aws:s3:::my.bucket", |
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
$ python xor.py | |
Training: | |
Epoch 0 MSE: 1.765 | |
Epoch 100 MSE: 0.015 | |
Epoch 200 MSE: 0.005 | |
* Target MSE reached * | |
Evaluating: | |
1 XOR 0 = 1 ( 0.904) Error: 0.096 | |
0 XOR 1 = 1 ( 0.908) Error: 0.092 | |
1 XOR 1 = 0 (-0.008) Error: 0.008 |
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
aws cloudformation list-stacks | jq ".StackSummaries[].StackId" -r | grep "PROD" | |
aws ec2 describe-instances --filters Name=tag:Stage,Values=PROD | jq ".Reservations[].Instances[].InstanceId" -r | |
aws elb describe-load-balancers | jq ".LoadBalancerDescriptions[].LoadBalancerName" -r | |
aws autoscaling describe-auto-scaling-groups | jq ".AutoScalingGroups[].AutoScalingGroupName" -r | grep "PROD" | |
aws s3 ls | grep "prod" | awk '{print $3}' | |
aws ec2 describe-vpcs | jq ".Vpcs[].VpcId" -r | |
aws dynamodb list-tables | jq ".TableNames[]" -r | grep "PROD" | |
aws sqs list-queues | jq ".QueueUrls[]" -r | grep "PROD" | |
aws sns list-topics | jq ".Topics[].TopicArn" -r | grep "PROD" |
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
function countChars(word) { | |
var counts = {}; | |
for (var i = 0; i < word.length; i++) { | |
var letter = word[i]; | |
if (letter in counts && counts.hasOwnProperty(letter)) { | |
counts[letter]++; | |
} else { | |
counts[letter] = 1; |
OlderNewer