Skip to content

Instantly share code, notes, and snippets.

View santiago's full-sized avatar

Santiago Gaviria santiago

  • Ontoworks
  • Planet Earth
View GitHub Profile
a=600851475143
#a=11351340
last_prime= 2
counter= 2
prime_factors= []
factoring= 1
def factor_by(number, factor)
if number.modulo(factor) == 0
@count= @count.nil? ? 1 : @count+1
devel@eCouplecoach:~$ npm install express
npm info it worked if it ends with ok
npm info version 0.2.2
npm ERR! Error: Failed to make /usr/local/lib/node/.npm/.tmp while ensuring /usr/local/lib/node/.npm/.tmp
npm ERR! EACCES, Permission denied '/usr/local/lib/node/.npm/.tmp'
npm ERR! at MKDIRCB (/usr/local/lib/node/.npm/npm/0.2.2/package/lib/utils/mkdir-p.js:33:29)
npm ERR! at cb (/usr/local/lib/node/.npm/npm/0.2.2/package/lib/utils/graceful-fs.js:28:9)
npm ERR! at node.js:608:9
npm ERR! try running: 'npm help install'
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
app.post('/admin/couple_fun/games', function(req, res) {
console.log(sys.inspect(req));
res.send("nada");
});
$ curl --data "birthyear=1905&press=%20OK%20" http://localhost:8000/admin/couple_fun/games
{ socket:
{ fd: 8
, type: 'tcp4'
def create
@user = User.new(params[:user])
if @user.save
# it should add an activation code
@activation_code= Digest::SHA1.hexdigest(@user.login+Time.now.to_s)
@user.update_attributes({:code => @activation_code})
# it should convert birthdate params to Date type
date= params[:year]
if params[:month].strip =~ /^\d{2}$/
server {
listen 80;
server_name table-press.com www.table-press.com;
access_log logs/tablepress.access.log;
  
location / {
proxy_pass http://127.0.0.1:8080;
}
}
_remove_editor: function() {
var $el= this.element;
$el.attr("style",null);
var content= this._wysiwyg.wysiwyg("getContent");
this._wysiwyg.wysiwyg("destroy");
$el.html(content);
this._reset(); // cuando esta línea está presente ninguna de las líneas anteriores se llama
this.destroy();
}
@santiago
santiago / gist:661878
Created November 3, 2010 23:10
Working OK in OSX, but ain't working in Ubuntu 10.04
app.configure(function(){
app.use(express.bodyDecoder());
});
app.put('/admin/couple_fun/games', function(req, res) {
var game= {};
var game_data= req.param('game');
Game.findById(game_data.id, function(game) { // <----- Error is here (line 44) game_data is undefined
set_game(game, game_data);
{ socket:
{ fd: 7
, type: 'tcp4'
, secure: false
, _readWatcher: { callback: [Function] }
, readable: true
, _writeQueue: []
, _writeQueueEncoding: []
, _writeQueueFD: []
, _writeWatcher: { socket: [Circular], callback: [Function: _doFlush] }
{ socket:
{ fd: 8
, type: 'tcp4'
, secure: false
, _readWatcher: { callback: [Function], socket: [Object] }
, readable: true
, _writeQueue: []
, _writeQueueEncoding: []
, _writeQueueFD: []
, _writeWatcher: { socket: [Circular], callback: [Function] }
neohomerico:Projects santiago$ sudo npm list | grep installed
npm ERR! sudon't!
npm ERR! sudon't! Running npm as root is not recommended!
npm ERR! sudon't! Seriously, don't do this!
npm ERR! sudon't!
npm info it worked if it ends with ok
npm info version 0.2.0
[email protected] =creationix active installed latest remote
[email protected] =tjholowaychuk active installed latest remote
[email protected] =tjholowaychuk active installed remote