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
-- assigning nil to object is not enough. You should also call remove. | |
display.remove( displayObject ) | |
displayObject = nil |
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
# if any encoding stuff doesnt save your ass, and you have to figure out | |
# you can regexp it out! | |
# TODO: will be improved | |
"any bad ass text".gsub(/[^A-Za-z 0-9 üÜıİöÖşŞğĞçÇ\.,\?'""!@#\$%\^&\*\(\)-_=\+;:<>\/\\\|\}\{\[\]`~]*/i, '') |
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
# on your project's root folder, | |
echo 'rvm --create --rvmrc use your-ruby-version@your-gemset-name' > .rvmrc |
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
# passenger-nginx-module will try to compile nginx if you choose option 1, so it will try to use gcc. | |
# default gcc version on ubuntu 11.10 is gcc-4.6 and there will be linkage order problems while compilation of nginx | |
# to pass that issue you can simply install gcc-4.4 and tell passenger to use that specific version. | |
#first install gcc-4.4 | |
sudo apt-get install gcc-4.4 g++-4.4 libstdc++6-4.4-dev | |
#then install passenger-nginx-module by telling specific gcc version will be used | |
rvmsudo CC=gcc-4.4 passenger-install-nginx-module # if you use rvm |
NewerOlder