Skip to content

Instantly share code, notes, and snippets.

View flockonus's full-sized avatar
🏯

Fabiano flockonus

🏯
View GitHub Profile
@flockonus
flockonus / development.log
Created October 26, 2010 23:41
Fabiano's dev log, slow?
# Logfile created on Tue Oct 26 21:16:39 -0200 2010* Loaded locales: ["brca", "da", "de", "el", "en", "eo", "es", "es-419", "fr", "gl", "ia", "id", "it", "ja", "ko", "mk", "nl", "pt-BR", "pt-PT", "ru", "te"]
admin['$cmd'].find({:ismaster=>1}, {}).limit(-1)
shapado-development['$cmd'].find({"$eval"=>"db.system.js.save({_id: 'find_tags', value: function find_tags(collection, regex, query, limit) {\n var counts = db.eval(\n function(collection, regex, query){\n var counts = {};\n db[collection].find(query, {\"tags\":1}).limit(500).forEach(\n function(p){\n if ( p.tags ){\n for ( var i=0; i<p.tags.length; i++ ){\n var name = p.tags[i];\n if(name.match(regex) != null)\n counts[name] = 1 + ( counts[name] || 0 );\n }\n }\n }\n );\n return counts;\n },\n collection,\n regex,\n query\n );\n\n var tags = [];\n for ( var tag in counts ){\n tags.push( { name : tag , count : counts[tag]
@flockonus
flockonus / ActionLogger - FlockonUS.rb
Created November 1, 2010 23:15
/lib/action_logger.rb
class ActionLogger
@@queue = []
@@limit = (Rails.env == 'development' ? 0 : 100 )
def self.add(str)
@@queue.push(str)
store! if @@queue.size >= @@limit
end
def self.store!
@flockonus
flockonus / ApplicationController.rb
Created November 1, 2010 23:17
/app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
protect_from_forgery
after_filter :log_action_taken
def current_user
@current_user ||= UserSession.find.try :user
end
# ====== > Should be a plugin along with action_logger.rb
@flockonus
flockonus / champ.rb
Created November 17, 2010 17:37
its a model
class Game::Champ < ActiveRecord::Base
belongs_to :user
# I want here, to have a has many Game::Item using a table for that.
end
@flockonus
flockonus / My app Routes
Created February 5, 2011 21:59
rake routes
rake routes
(in /home/fps/workspace3/peded)
admin_pay_methods GET /admin/pay_methods(.:format) {:action=>"index", :controller=>"admin/pay_methods"}
POST /admin/pay_methods(.:format) {:action=>"create", :controller=>"admin/pay_methods"}
new_admin_pay_method GET /admin/pay_methods/new(.:format) {:action=>"new", :controller=>"admin/pay_methods"}
edit_admin_pay_method GET /admin/pay_methods/:id/edit(.:format) {:action=>"edit", :controller=>"admin/pay_methods"}
admin_pay_method GET /admin/pay_methods/:id(.:format) {:action=>"show", :controller=>"admin/pay_methods"}
PUT /admin/pay_methods/:id(.:format) {:action=>"update", :controller=>"admin/pay_methods"}
DELETE /admin/
@flockonus
flockonus / bulky.rb
Created March 4, 2011 21:23
Rails 3 Model
class Admin::Bulky
CADASTRADO = "CADASTRADO"
INVALIDO = "INVALIDO"
# requires w: a workingsheet from the GoogleSpreadsheet lib
def self.import_restaurants( w )
# The headers I expect to be there, in String
fields = ['nome', 'tipo', 'telefone', 'endereço', 'cep', 'funcionamento', 'status']
@flockonus
flockonus / bulkies_controller.rb
Created March 4, 2011 21:28
Feito com base em nifty_scaffold
class Admin::BulkiesController < ApplicationController
#layout 'admin'
#before_filter :admin_area
def index
return redirect_to '/admin/bulkies/auto/add_stores'
end
# Here the user gets a list of his spreadsheets from his GoogleDocs, if auth
def add_stores
@flockonus
flockonus / .irbrc
Created March 9, 2011 20:54
Meu IRBRC pessoal
require "irb/completion" # activate default completion
require 'irb/ext/save-history' # activate default history
require 'pp'
# save history using built-in options
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
puts "History configured."
# Critical default settings:
disable_system_gems
disable_rubygems
bundle_path '.gems/bundler_gems'
# List gems to bundle here:
gem 'rails_dm_datastore'
gem 'rails', "2.3.5"
# Needed for Devise-Plugin
Template Padrão
Tamiris Cristina 10:08:20Olá soro, em que posso ajudar?
soro 10:08:53olá, estou com um problema quanto a um boleto de renovação que recebi
Tamiris Cristina 10:09:32Bom dia me informa por favor o código de cliente
soro 10:09:45login: soro, meu código de cliente é xxx
Tamiris Cristina 10:11:22sobre a renovação do domínio jaeh.net?
soro 10:11:48 sim
soro 10:12:03 estou sendo lezado em 2 meses
soro 10:12:27no painel está que expira em [Expira em : 30/06/2011], e tenho um email confirmando isso
Tamiris Cristina 10:12:33não entendi