Skip to content

Instantly share code, notes, and snippets.

View divoxx's full-sized avatar

Rodrigo Kochenburger divoxx

View GitHub Profile
@divoxx
divoxx / gist:594580
Created September 23, 2010 23:11 — forked from mmurray/gist:594579
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable, :token_authenticatable,
:oauthable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :has_username, :is_admin, :profile
puts "Type 'end' at any point to calculate the average."
marks = []
sum = 0
while mark != "end"
print "Enter Mark: "
mark = gets.chomp
break if mark == "end"
# Iterate the directory tree up looking for a .rvmruby file.
# If it finds one, it executes rvm use ${content_of_.rvmruby}.
#
# This way you can easily automate ruby version switching for
# some projects.
rvm_set_ruby_for_path() {
orig_path=$(pwd)
until [[ -f .rvmruby || `pwd` == "/" ]]; do
builtin cd ..
class YourModel < ActiveRecord::Base
def yourattribute=(new_value)
self[:yourattribute] = new_value.to_i.round
end
end
$.fn.foobar = function() {
console.log("foobar");
}
$(document).ready(function() {
$(".foobar").foobar();
});
package com.divoxx;
class Driver {
private Element element;
Driver(Element element) {
this.element = element;
}
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ACE_INCLUDE_DIR (ADVANCED)
used as include directory in directory /Users/divoxx/Development/Projects/OpenSource/TrinityCore/src/server/shared
used as include directory in directory /Users/divoxx/Development/Projects/OpenSource/TrinityCore/src/server/game
used as include directory in directory /Users/divoxx/Development/Projects/OpenSource/TrinityCore/src/server/collision
used as include directory in directory /Users/divoxx/Development/Projects/OpenSource/TrinityCore/src/server/authserver
used as include directory in directory /Users/divoxx/Development/Projects/OpenSource/TrinityCore/src/server/scripts
used as include directory in directory /Users/divoxx/Development/Projects/OpenSource/TrinityCore/src/server/worldserver
ACE_LIBRARY (ADVANCED)
divoxx@wizard ~ : goinstall go-gb.googlecode.com/hg/gb
/bin/bash: === cd /usr/local/Cellar/go/HEAD/src/pkg/go-gb.googlecode.com/hg/gb; bash gomake -f- install
6g -I "/usr/local/Cellar/go/HEAD/pkg/darwin_amd64" -I "/usr/local/share/go/pkg/darwin_amd64" -o _go_.6 build.go cgo.go deps.go files.go gb.go genmake.go gentest.go gofix.go gofmt.go goinstall.go make.go pkg.go protobuf.go query.go runext.go usage.go util.go
pkg.go:255: cannot use this (type *Package) as type filepath.WalkFunc in function argument
pkg.go:255: too many arguments in call to filepath.Walk
make: *** [_go_.6] Error 1
--- exit status 2
goinstall: go-gb.googlecode.com/hg/gb: install: running bash: exit status 2
roar_test.rb:11:in `initialize': wrong number of arguments(1 for 0) (ArgumentError)
from roar_test.rb:11:in `new'
from roar_test.rb:11:in `<main>'
@divoxx
divoxx / gist:1401911
Created November 28, 2011 20:33
Reinstall all gems
gem list | cut -d ' ' -f 1 | tee gems.txt | xargs gem uninstall -I -a && for path in $(echo `gem env path` | tr ":" "\n"); do rm -rf ${path}/specifications/* ${path}/cache/*; done && cat gems.txt | xargs gem install
rm gems.txt