Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am argami on github.
  • I am argami (https://keybase.io/argami) on keybase.
  • I have a public key ASDBhlriQI0kaeuzUd9x-WdXxOMfPKlAtyzJzS8cyuiGiAo

To claim this, I am signing this object:

@argami
argami / config
Created September 11, 2012 12:18
Way to patch error on ngnix and streams
upstream www.XXXXXXX.es {
server XXX.XXX.XXX.XXX:3000;
}
server {
listen 80;
server_name www.XXXX.es XXXXX.es;
location / {
proxy_pass http://www.XXXXXXX.es; #this is the upstream option
@argami
argami / steps
Created August 17, 2012 12:26
Xiki on 1.8.7
rvm install ruby-1.8.7-p358
rvm use --create 1.8.7@xiki
gem install bundler
bundle
gem build xiki.gemspec
gem install xiki-0.5.0a.gem
Output
@argami
argami / base_controller_decorator.rb
Created August 1, 2012 18:47
Locale on engine mount point (Spree)
Spree::BaseController.class_eval do
before_filter :set_user_language
def set_user_language
I18n.locale = params[:locale]
end
end
@argami
argami / Test.js
Created July 25, 2012 14:34
Error on Mocha
require('should');
function a() {
throw new Error("Oops");
return 1;
}
describe('MyLibrary', function(){
it('handles errors', function(){
a().should.equal(1);
@argami
argami / README
Created October 8, 2011 10:20
Openerp Server Requirements
Installation instruction
curl https://raw.github.com/gist/1272098/e0199b49a72121c5e24b19275e7d544529c9e688/openerp-install.sh -o | sh
@argami
argami / text_width_canvas.coffee
Created September 27, 2011 17:44
Right measurement of text width on Javascript using canvas
measure_text: (text, font_size, font_family) ->
canvas = document.createElement('canvas')
ctx = window.canvas.getContext '2d'
ctx.font = "#{font_size} #{font_family}"
ctx.measureText(text).width