Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the repository field in order to avoid the new npm v1.2.20 warning #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-42843113-1']);
_gaq.push(['_setAccount', 'UA-42972788-1']);
_gaq.push(['_trackPageview']);

(function() {
Expand Down Expand Up @@ -205,7 +205,19 @@ <h3>10</h3> <p>days left</p>
</div>
<div class="row-fluid">
<div class="span6 offset3 order">
<a class="coinbase-button"
data-code="951d3d74a05b99cf05b3b03338ed6087"
data-button-style="custom_large"
data-button-text="Bitcoin Tip Jar"
href="https://coinbase.com/checkouts/951d3d74a05b99cf05b3b03338edkj">
Bitcoin Tip Jar
</a>
<script src="https://coinbase.com/assets/button.js"
type="text/javascript"></script>
<!--
<a class="coinbase-button" data-button-style="custom_large" data-button-text="Preorder with Bitcoin" data-code="13b56883764b54e6ab56fef3bcc7229c" href="https://coinbase.com/checkouts/13b56883764b54e6ab56fef3bcc7229c">Preorder with Bitcoin</a><script src="https://coinbase.com/assets/button.js" type="text/javascript"></script>
/* Class Button: use mine instead */
-->
</div>
</div>
<div class="row-fluid">
Expand Down Expand Up @@ -331,7 +343,7 @@ <h3>FAQ</h3>
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-42843113-1', 'bitstart.net');
ga('create', 'UA-42972788-1', 'wherearemyfiles.net');
ga('send', 'pageview');

</script>
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/startup-class/bitstarter-ssjs-db.git"
},
"dependencies": {
"sequelize": "~2.0.0-alpha2",
"pg": "~2.3.1",
Expand Down
1 change: 1 addition & 0 deletions pgsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sudo apt-get install -y postgresql postgresql-contrib

# Symlink into home.
# Note the use of backticks, PWD, and the -t flag.
# allows for auto-login with "psql"
ln -sf `ls $PWD/.pgpass` -t $HOME
chmod 600 $HOME"/.pgpass"

Expand Down
8 changes: 4 additions & 4 deletions setup-ssjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ echo -e "\n\nNOW ENTER YOUR HEROKU PASSWORD"
# Set up heroku.
# - devcenter.heroku.com/articles/config-vars
# - devcenter.heroku.com/articles/heroku-postgresql
heroku login
#heroku login
heroku create
ssh-keygen -t rsa
heroku keys:add
#ssh-keygen -t rsa
#heroku keys:add
heroku addons:add heroku-postgresql:dev
heroku pg:promote `heroku config | grep HEROKU_POSTGRESQL | cut -f1 -d':'`
heroku plugins:install git://github.com/ddollar/heroku-config.git
Expand All @@ -19,7 +19,7 @@ heroku plugins:install git://github.com/ddollar/heroku-config.git
# - Edit .env to include your own COINBASE_API_KEY and HEROKU_POSTGRES_URL.
# - Modify the .env.dummy file, and DO NOT check .env into the git repository.
# - See .env.dummy for details.
cp .env.dummy .env
#cp .env.dummy .env

# For local: setup postgres (one-time) and then run the local server
./pgsetup.sh
Expand Down
44 changes: 44 additions & 0 deletions web.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,50 @@ app.get('/orders', function(request, response) {
});
});

// Show some configuration variables -- this works, but isn't at all secure,
// so we shouldn't actually use it in production
/*
app.get('/dbconfig', function(request, response) {
response.send(global.db.sequelize.config);
});
*/

// This is also not very secure (mind you, /orders isn't either), and is also
// pretty ugly. But it felt good to write and get working!
// ah go on, let it run -- when in Development
app.get('/addrs', function(request, response) {
if (process.env.DEVELOPMENT) {
https.get("https://coinbase.com/api/v1/addresses?api_key=" + process.env.COINBASE_API_KEY, function(res) {
var body = '';
res.on('data', function(chunk) {body += chunk;});
res.on('end', function() {
// response.send("Hi, here are your addresses:" + body);
var output = '';
var addresses_json = JSON.parse(body);
if (addresses_json.error) {
response.send(addresses_json.error);
return;
}
// don't bother with fancy DB entries or asynchronicity
addresses_json.addresses.forEach(function(address) {
output += "address " + address.address.address +
" at " + address.address.created_at + "<br>";
});
response.send("Your addresses:<br>" + output);
});

res.on('error', function(e) {
console.log(e);
response.send("error getting addresses");
});
});
}
else {
response.send("nope, nothing to see here.");
}
});
// end little test

// Hit this URL while on example.com/orders to refresh
app.get('/refresh_orders', function(request, response) {
https.get("https://coinbase.com/api/v1/orders?api_key=" + process.env.COINBASE_API_KEY, function(res) {
Expand Down