When I'm not spending time with Jessica and my kids ... I build web applications. Ruby on Rails developer, believer of Agile Development and Lean startups. NoSQL enthusiast.
Movistar no da soporte para el uso de su Internet Móvil en Mac OS X 10.7 (Lion), solamente soportan desde 10.4 hasta 10.6. Sin embargo, si funciona, he aquí lo que yo hice para configurarlo:
De la página de Movistar sigues las instrucciones para descargar e instalar el Escritorio Movistar.
Cuando lo instales es muy probable que te de un error como me ocurrió a mi
No te preocupes, hazle un restart a la máquina y en tus aplicaciones vas a tener el “Escritorio movistar Latam”, arranca la aplicación, en mi caso la aplicación detectaba el modem Huawei pero no se conectaba, si te ocurre lo mismo, ve a “Escritorio Movistar Settings” y vas a “My Internet connections”, ahi editas la conexión por defecto o creas una nueva (y la luego la marcas como por defecto).
Los cambios que hay que hacer en la conexión son:
Guardas los cambios (recuerda que la conexión debe ser la usada por defecto) Y eso es todo, ya deberías poder conectarte
In ActionMailer (Rails 3) you can’t decide not to send an email. For instance, you have the following mailer:
class FooMailer < ActionMailer::Base
def bar_email
if some_condition
mail(...)
else
# Can I do nothing? No :-(
end
end
end
If you invoke FooMailer.bar_email.deliver!, when same_condition is false you will get the following error:
ArgumentError: A sender (Return-Path, Sender or From) required to send a message
The workaround for that is move the condition to the place where you are making the call to FooMailer.bar_email.deliver!
To add your Heroku application as a remote in your git repository, use the following command:
git remote add heroku-remote git@heroku.com:project.git
Where project.git is your heroku application, and heroku-remote the name you want for the remote, in my case I usually have several remotes, one for production, staging and dev
Esta es la presentacion que di en el BogotaConf (@bogotaconf) sobre NoSQL
Edit the file: /path/to/SublimeText2/Packages/Ruby/Ruby.sublime-build to contain this:
{
"cmd": ["/path/to/ruby/bin/ruby", "-cw", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
Then create the following file /path/to/SublimeText2/Packages/User/ruby_check.py:
import sublime, sublime_plugin
class rubyCheck(sublime_plugin.EventListener):
def on_post_save(self, view):
if view.file_name()[-3:] == '.rb':
view.window().run_command("build")
Now when you save your ruby file automatically the syntax will be checked
Here the gist
All things in the universe start from a point and return to a point. One point calls up a new point, and extends into a line. Everything is a scene of gathering and dispersal of points and lines. Existence is a point and life is a line, so I am also a point and a line
If you’re working in your feature-branch:
git checkout feature-branch
and by mistake you pull from a wrong branch (usually master or develop):
git pull origin different-branch
You can fix it with this:
git reset --hard origin/feature-branch
I’m building a JSON API using rails. In several places I only need to send a 200 http code, without response body.
So, I used the head method:
head :ok
But this returns a response body with one blank character, this single space body causes the mobile client to fail (parse error). Below the response (notice the Content-Length):
HTTP/1.1 200 OK Server: nginx/0.7.67 Date: Tue, 06 Sep 2011 14:13:55 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive Piictu_version: 1.0.14 Cache-Control: no-cache Content-Length: 1 X-Ua-Compatible: IE=Edge,chrome=1 X-Runtime: 0.273965
So, I created a render_ok method to use instead of head:
def render_ok response.headers['Cache-Control'] = 'no-cache' render json: '' end
And now the response is:
HTTP/1.1 200 OK Server: nginx/0.7.67 Date: Tue, 06 Sep 2011 16:14:05 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Cache-Control: no-cache Etag: "d41d8cd98f00b204e9800998ecf8427e" Piictu_version: 1.0.14 X-Ua-Compatible: IE=Edge,chrome=1 X-Runtime: 0.224352
Now the Content-Length header is not present :). I use render json: '', because I want the Content-Type to be application/json, but you can use render text: '' too.
If you want to delete a database named ‘dummy_db’ just do this:
$ mongo
> use dummy_db
switched to db dummy_db
> db.dropDatabase()
{ "dropped" : "dummy_db", "ok" : 1 }
Github’s ‘compare views’ feature is owosome! I use a lot, in particular to generate change log for releases.
The Compare View URL structure is:
http://github.com/edgar/<repository>/compare/<start branch>...<end branch>
More info in:
Recently I try to added mi Google App account to Empathy (chat client for linux), but wasn’t works at the first try, so I tried different settings and the trick is just “Ignore SSL certificate errors”
Now my setup is:
There is a lot of way to compare versions strings in ruby, for instance you turn each version string in to an array of integers and then use the array comparison operator. But I prefer this one:
Gem::Version.new('0.3.2') < Gem::Version.new('0.10.1')
Any fool can write code that a computers can understand. Good programmers write code that humans can understand