Skip to content

Instantly share code, notes, and snippets.

@microft
microft / gist:3438997
Created August 23, 2012 17:22
heroku crash
2012-08-23T17:19:38+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-23T17:19:42+00:00 heroku[web.1]: Starting process with command `thin -R config.ru start -p 36781 -e production`
2012-08-23T17:19:47+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/uri/common.rb:156:in `split': bad URI(is not URI?): (URI::InvalidURIError)
2012-08-23T17:19:47+00:00 app[web.1]: from /usr/local/lib/ruby/1.9.1/uri/common.rb:174:in `parse'
2012-08-23T17:19:47+00:00 app[web.1]: from /usr/local/lib/ruby/1.9.1/uri/common.rb:628:in `parse'
2012-08-23T17:19:47+00:00 app[web.1]: from /app/config/init.rb:13:in `block in <class:Raddar>'
2012-08-23T17:19:47+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1273:in `configure'
2012-08-23T17:19:47+00:00 app[web.1]: from /app/app.rb:20:in `require_relative'
2012-08-23T17:19:47+00:00 app[web.1]: from /app/config/init.rb:4:in `<class:Raddar>'
2012-08-23T17:19:47+00:00 app[web.1]: from /app/config/init.rb:2:in `<top (required)>'
2012-08-23T17:51:49+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-23T17:51:51+00:00 heroku[web.1]: Starting process with command `bundle exec thin -R config.ru start -p 22076 -e production`
2012-08-23T17:51:55+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/adapters.rb:12:in `new': +options+ should be Hash or Addressable::URI or String, but was NilClass (ArgumentError)
2012-08-23T17:51:55+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core.rb:230:in `setup'
2012-08-23T17:51:55+00:00 app[web.1]: from /app/config/init.rb:8:in `block in <class:Raddar>'
2012-08-23T17:51:55+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/sinatra-1.3.2/lib/sinatra/base.rb:1273:in `configure'
2012-08-23T17:51:55+00:00 app[web.1]: from /app/config/init.rb:4:in `<class:Raddar>'
2012-08-23T17:51:55+00:00 app[web.1]: from /app/config/init.rb:2:in `<top (required)>'
2012-08-23T17:51:55+00:00 app[web.1]: from /app/app.rb:20:in `require_rel
@microft
microft / gist:4069433
Created November 14, 2012 00:41
error and stuff
activerecord (3.2.8) lib/active_record/inheritance.rb:111:in `compute_type'
activerecord (3.2.8) lib/active_record/reflection.rb:172:in `klass'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/base/collections.rb:91:in `collection_from_association'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/base/collections.rb:46:in `raw_collection'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/base/collections.rb:51:in `collection'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/select_input.rb:157:in `select_html'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/select_input.rb:152:in `block in to_html'
actionpack (3.2.8) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.2.8) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
actionpack (3.2.8) lib/action_view/helpers/capture_helper.rb:40:in `capture'
@microft
microft / gist:4069445
Created November 14, 2012 00:45
currency errors
activemodel (3.2.8) lib/active_model/attribute_methods.rb:407:in `method_missing'
activerecord (3.2.8) lib/active_record/attribute_methods.rb:149:in `method_missing'
actionpack (3.2.8) lib/action_view/helpers/form_helper.rb:1154:in `value'
actionpack (3.2.8) lib/action_view/helpers/form_helper.rb:1145:in `value'
actionpack (3.2.8) lib/action_view/helpers/form_options_helper.rb:580:in `to_select_tag'
actionpack (3.2.8) lib/action_view/helpers/form_options_helper.rb:157:in `select'
actionpack (3.2.8) lib/action_view/helpers/form_options_helper.rb:642:in `select'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/select_input.rb:157:in `select_html'
/usr/local/lib/ruby/gems/1.9.1/gems/formtastic-2.1.1/lib/formtastic/inputs/select_input.rb:152:in `block in to_html'
actionpack (3.2.8) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
@microft
microft / gist:4566260
Created January 18, 2013 17:18
Vim function to forget undo history. Very usefull.
" A function to clear the undo history
function! <SID>ForgetUndo()
let old_undolevels = &undolevels
set undolevels=-1
exe "normal a \<BS>\<Esc>"
let &undolevels = old_undolevels
unlet old_undolevels
endfunction
command -nargs=0 ClearUndo call <SID>ForgetUndo()
@microft
microft / gist:5213590
Created March 21, 2013 14:46
my ~/.gitconfig
[user]
name = Luis Miguel Braga
email = luismiguel@silvabraga.com
[color]
ui = true
[alias]
lol = log --oneline --graph --decorate
pullall = submodule foreach git pull origin master
[core]
excludesfile = ~/.gitignore_global
[default] -- /vagrant
Failed to mount folders in Linux guest. This is usually beacuse
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant
javascript:location.href='http://attentive.us/api/article/new/?url='+encodeURIComponent(location.href)
@microft
microft / gideon.py
Created November 29, 2016 09:34
a small Flask service
from __future__ import division
import logging
from flask import Flask, request, jsonify
from gensim import corpora, models, similarities
SIMILARITY_THRESHOLD = 0.5
INDUSTRIES = {
'funding': {},
'txt50': {}
@microft
microft / 50-marblemouse.conf
Created February 9, 2019 14:41
xorg configuration for left handed logitech marble mouse (middle click and scroll) - Ubuntu 18.04
Section "InputClass"
Identifier "Logitech USB Trackbal"
MatchProduct "Logitech USB Trackball"
Driver "libinput"
Option "MiddleEmulation" "on"
Option "ScrollMethod" "button"
#Option "ButtonMapping" "1 2 3 4 5 6 7 8 9" # right handed
#Option "ScrollButton" "8" # right handed
Option "ScrollButton" "9" # left handed
Option "ButtonMapping" "3 9 1 4 5 6 7 2 8" #left handed