Skip to content

Instantly share code, notes, and snippets.

@0xGGGGG
0xGGGGG / main.lua
Created January 7, 2012 20:01
Corona SDK - Neon Effect in Text or Shape - First Way
--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
@0xGGGGG
0xGGGGG / removing-display-objects.lua
Created January 7, 2012 19:51
for memory screening
-- assigning nil to object is not enough. You should also call remove.
display.remove( displayObject )
displayObject = nil
@0xGGGGG
0xGGGGG / abs.js
Created January 2, 2012 13:54
Math.abs() performance
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();
});
@0xGGGGG
0xGGGGG / turkish-regexp.rb
Created November 27, 2011 19:19
turkish visible character set
# 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, '')
# 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;
@0xGGGGG
0xGGGGG / set-rvmrc
Created November 7, 2011 18:00
set a specific rvm gemset per project basis
# on your project's root folder,
echo 'rvm --create --rvmrc use your-ruby-version@your-gemset-name' > .rvmrc
@0xGGGGG
0xGGGGG / prep_for_passenger-nginx-module
Created November 7, 2011 14:27
solution to errors while installing passenger-nginx-module on ubuntu 11.10
# 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