Skip to content

Instantly share code, notes, and snippets.

View pantulis's full-sized avatar

Juan Lupion pantulis

View GitHub Profile
0x5b169DdCbf057c7518a29D7ff7b0cc1dEB76ff16
@pantulis
pantulis / gist:8b920e44020773f59d01
Created February 2, 2016 12:09
Spacemacs snippet to remap special keys
(defun dotspacemacs/user-config ()
"Configuration function for user code.
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
(global-set-key [(M +)] "]")
(global-set-key [(M ?\ç)] "}")
(global-set-key [(M \1)] "|")
(global-set-key [(M \2)] "@")
@pantulis
pantulis / .htaccess
Created August 30, 2014 12:12
Fichero .htaccess a editar (ojo con el .!)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !(.*)png$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.html [L,QSA]
@pantulis
pantulis / gist:5460679
Created April 25, 2013 15:37
Prueba de carga en CouchDB y búsqueda por tags en ElasticSearch.
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'json/ext'
require 'couchrest'
require 'tire'
require 'yajl/json_gem'
require 'faker'
# Get the official Emacs repo:
git clone http://repo.or.cz/r/emacs.git/
# Get the fullscreen patch
git remote add typester git://github.com/typester/emacs.git
git fetch typester
# Create a patch and apply to HEAD
# I had merge conflicts when rebasing and
# build failures for origin/emacs-23
juan@Manzanito ~/Documents
$ irb
>> require 'time'
=> true
>> Time.now
=> Tue Aug 11 10:08:07 +0200 2009
>> Time.parse("17:00 PST")
=> Wed Aug 12 03:00:00 +0200 2009
>>
class MyRackFilter
def initialize(app, logger = nil)
@app = app
@logger = logger
end
def call(env)
@logger.debug("Hit, hit!")
status, headers, response = @app.call(env)
end
ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: blogs: SELECT * FROM "blogs" ):
/app/controllers/blogs_controller.rb:5:in `index'
thin (0.6.4) lib/thin/connection.rb:35:in `process'
thin (0.6.4) lib/thin/connection.rb:23:in `receive_data'
eventmachine (0.10.0) lib/eventmachine.rb:1056:in `event_callback'
eventmachine (0.10.0) lib/eventmachine.rb:224:in `run_machine'
eventmachine (0.10.0) lib/eventmachine.rb:224:in `run'
thin (0.6.4) lib/thin/server.rb:113:in `start'
thin (0.6.4) lib/thin/controllers/controller.rb:59:in `start'
thin (0.6.4) lib/thin/runner.rb:143:in `send'
ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: blogs: SELECT * FROM "blogs" ):
/app/controllers/blogs_controller.rb:5:in `index'
thin (0.6.4) :lib/thin/connection.rb:35:in `process'
thin (0.6.4) :lib/thin/connection.rb:23:in `receive_data'
eventmachine (0.10.0) :lib/eventmachine.rb:1056:in `event_callback'
eventmachine (0.10.0) :lib/eventmachine.rb:224:in `run_machine'
eventmachine (0.10.0) :lib/eventmachine.rb:224:in `run'
thin (0.6.4) :lib/thin/server.rb:113:in `start'
thin (0.6.4) :lib/thin/controllers/controller.rb:59:in `start'
thin (0.6.4) :lib/thin/runner.rb:143:in `send'
Processing BlogsController#index (for 127.0.0.1 at 2008-11-29 21:00:06) [GET]
Blog Load (0.0ms) SQLite3::SQLException: no such table: blogs: SELECT * FROM "blogs"
ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: blogs: SELECT * FROM "blogs" ):
/app/controllers/blogs_controller.rb:5:in `index'
/opt/local/lib/ruby/gems/1.8/gems/thin-0.6.4/lib/thin/connection.rb:35:in `process'
/opt/local/lib/ruby/gems/1.8/gems/thin-0.6.4/lib/thin/connection.rb:23:in `receive_data'
/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:1056:in `event_callback'
/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:224:in `run_machine'
/opt/local/lib/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:224:in `run'