This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
//works | |
//import world.Entity; | |
//works | |
//import world.IEntity; | |
//import world.Entity; | |
//not work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app/filters/user.rb | |
FilterIt.create('user') do | |
requires :name, :class => String # stop the filter if no name is found on 'data' | |
if current_user.admin? # search in each context for one that respond to the method 'current_user' without an error | |
# optional will not raise an error if isn't found, if any validation fail it will be simply ignored. | |
optional :authorizantion_level, :class => Integer,:in => 0..10 | |
end | |
if current_user.manager? | |
optional :org_ids, :class => Array do | |
unless (is_creating_user rescue false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCRIPT_LINES__ = {} | |
require './test' | |
puts SCRIPT_LINES__.keys | |
# [".../test.rb"] | |
puts SCRIPT_LINES__.first[1].join | |
# def foo | |
# puts "bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deep = Hash.new { |hash, key| hash[key] = Hash.new(&hash.default_proc) } | |
# {} | |
deep[:foo][:bar][:lol?][:win!] = 10 | |
# 10 | |
deep | |
# {:foo=>{:bar=>{:lol?=>{:win!=>10}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Today I've updated my gems and got this error with ActiveRecord::Base#to_json | |
>> User.all.to_json | |
=> "[\"#<User:0x6a9eb00>\",\"#<User:0x6a9ea60>\",\"#<User:0x6a9e9c0>\",\"#<User:0x6a9e920>\"]" #this isn't what I want | |
I think the problems is json_pure :/ but I can't remove it from project(some gems depend on it) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> User.all.to_json | |
=> "[\"#<User:0x6a9eb00>\",\"#<User:0x6a9ea60>\",\"#<User:0x6a9e9c0>\",\"#<User:0x6a9e920>\"]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Account 5 | Sem data | |
Act 2078164 | 2010-08-26 18:26:37 UTC | |
Address 169 | Sem data | |
Area 12 | 2009-06-02 11:52:57 UTC | |
Article 0 | Sem data | |
Avl 354 | 2008-08-27 20:10:47 UTC | |
AvlMacro 0 | Sem data | |
AvlProfile 0 | Sem data | |
BackupHost 0 | Sem data | |
Booth 29 | 2008-12-19 16:26:31 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import <Foundation/CPObject.j> | |
@import "PageView.j" | |
@import "PhotoInspector.j" | |
@implementation AppController : CPObject | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IRBRC file by Iain Hecker, http://iain.nl | |
# put all this in your ~/.irbrc | |
require 'rubygems' | |
require 'yaml' | |
alias q exit | |
class Object | |
def local_methods | |
(methods - Object.instance_methods).sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=Nanite.request('/integra_out/command', 45805) | |
=> #<Nanite::Job:0x74b6d90 @intermediate_state={}, @targets=["nanite-integra3"], @request=#<Nanite::Request:0x74be860 @selector=:least_loaded, @size=nil, @from="mapper-9a828281d56e78c397d2f41ee0f4f28b", @target=nil, @type="/integra_out/command", @tags=[], @token="f7e9b788f368047be12ff7daaa4abc3b", @persistent=false, @reply_to="mapper-9a828281d56e78c397d2f41ee0f4f28b", @payload=45805>, @results={}, @completed=nil, @pending_keys=[], @token="f7e9b788f368047be12ff7daaa4abc3b", @intermediate_handler=nil> | |
>> [Thu, 24 Jun 2010 17:24:30 -0300] ERROR: RECV [result] Could not load "--- !ruby/object:Nanite::Result \nfrom: nanite-integra3\nresults: &id003 !ruby/object:MQ::Exchange \n key: \n mq: &id002 !ruby/object:MQ \n _send_mutex: !ruby/object:Mutex {}\n\n callbacks: \n channel: 1\n connection: &id001 !ruby/object: \n _channel_mutex: !ruby/object:Mutex {}\n\n buf: !ruby/object:AMQP::Buffer \n data: \"\"\n pos: 0\n callbacks: []\ |
NewerOlder