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
# Config for Nginx to act as a front-end for Riak | |
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc) | |
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_) | |
# Config is in /etc/nginx/sites-available/default or somewhere like that | |
# Set up load-balancing to send requests to all nodes in the Riak cluster | |
# Replace these IPs/ports with the locations of your Riak nodes | |
upstream riak_hosts { | |
server 127.0.0.1:8098; |
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
var test = require('testling'); | |
test('Math.abs performance', function (t) { | |
var t0 = new Date; | |
for (var i = 0; i < 100 * 1000; i++) Math.abs(i - 50 * 1000) | |
t.log(new Date - t0); | |
t.end(); | |
}); |
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
--a not effective way to make a neon text in corona sdk, the trick is make a loop and down the alpha | |
--you can use it to make shapes in neon too ;) | |
--email me: [email protected] ;) | |
---Circle Example | |
--i = 0 | |
--while i < neonSize do | |
-- t = display.newCircle(x,y,circleSize + i) --create the circle | |
-- t:setFillColor(colorR,colorG,colorB) --set the color of the text | |
-- t.alpha = 1/i * 1 --change alpha |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, http = require('http'); | |
var app = express(); | |
var server = app.listen(3000); |
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
#!/bin/bash -xe | |
#THIS SCRIPT MUST BE RUN AS ROOT | |
#configure SSH | |
SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuwaDITgrsmxVvSJ+HEir4iW2eBb8XqB3wIxCWJwmhiB2S6MkdX1CFcj8boHL2RIYgKN0yiTCVlOdQFjhyRpnd8NbS0RW7753SE1hzkgOg+2e1B15lf1PCSD5OPWAtpb1eYlLcs6hns+yFhYCFeQrKLBL2/si8D8OcQcTR7BjjFQEWdhjl4cYiT68cr57yFT+c/f32ZTynEWukC2YIGMjJ1nACUOYF8CSp6RUrD2kY3C1Pb1Q5V3jwi0lhay4aF5AWp28hPVtYASBe2BrYXp8uErhnmWxgXNV19P0NSHE7TBXd9nXz/njI2SDP/p2N/vHquz/Ybxs4F+kGGXknUFitQ== [email protected]" | |
echo $SSH_KEY >> /home/ubuntu/.ssh/authorized_keys | |
#configure locale | |
echo "export LANGUAGE=en_AU.UTF-8" > /tmp/locale |
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
.highlight { | |
background-color: #efefef; | |
padding: 7px 7px 7px 10px; | |
border: 1px solid #ddd; | |
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1); | |
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1); | |
box-shadow: 3px 3px rgba(0,0,0,0.1); | |
margin: 20px 0 20px 0; | |
overflow: hidden; |
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
create new rails app: | |
$ rails new store_name -d postgresql | |
in postgres: | |
$ psql -U postgres | |
$ create role store_name login createdb; | |
create databases: |
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
# Clone rbenv into ~/.rbenv | |
git clone [email protected]:sstephenson/rbenv.git ~/.rbenv | |
# Add rbenv to your PATH | |
# NOTE: rbenv is *NOT* compatible with rvm, so you'll need to | |
# remove rvm from your profile if it's present. (This is because | |
# rvm overrides the `gem` command.) | |
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
exec $SHELL |