Skip to content

Instantly share code, notes, and snippets.

View raulsouzalima's full-sized avatar
🤘

Raul Souza Lima raulsouzalima

🤘
View GitHub Profile
@raulsouzalima
raulsouzalima / test3.rb
Created February 3, 2016 13:44 — forked from devdave/test3.rb
Working SA auth for Google analytics
require 'pry'
require 'rubygems'
require 'google/api_client'
passPhrase = "notasecret"
keyFile = "YOUR KEY HERE-privatekey.p12"
cID = "YOUR ID HERE.apps.googleusercontent.com"
scope = 'https://www.googleapis.com/auth/analytics.readonly'
profileID = "YOUR PROFILE ID"
email = 'YOUR_SA_ACCOUNT_EMAIL_HERE@developer.gserviceaccount.com'
@raulsouzalima
raulsouzalima / gist:39b9d36da11f24109725
Created January 29, 2016 22:55
Busca por multiplas combinações de resultados baseado em 2 parâmetros no log
cat log/production.log | grep -E "(201501284509.+P14020004|201601424892.+P14020004)"
module Reports
class ActiveUsersCreditsByPublicationAndInstitution < ActiveUsersByInstitution
def records
# retorna os usuários ativos em um período do redshift
User.with_deleted.select("login, active, bonus_quota").where(system_id: reporter.system.id).includes(:deactivation_periods)
.where("users.created_at <= :end_of_month", end_of_month: end_of_month)
.where("deleted_at is null or deleted_at >= :beginning_of_month", beginning_of_month: beginning_of_month)
.where("(deactivation_periods.id is null and active is true) or (deactivation_periods.id is not null and ((#{changed_state_in_period}) or (#{changed_state_before_or_after_period})) and not (#{where_inactive_around_period}))", beginning_of_month: beginning_of_month, end_of_month: end_of_month)
end
@raulsouzalima
raulsouzalima / gist:4250676
Created December 10, 2012 13:53
click ie8
http://ia.nspmotion.com/click/?cap=110915&c=19959&r="+e.timeStamp+"&t=true
@raulsouzalima
raulsouzalima / gist:4250675
Created December 10, 2012 13:52
pixel ie8
http://ia.nspmotion.com/tracking/?p=81413&sc=19959&r='+$.now()+'
Yes I got (the invitation to fight against Weidman), but I have other projects for the coming months and do not intend to fight back now. There is no lack of humility on my part. I'm in a comfort zone, I can afford to say no.
Product Load (4.3ms) SELECT `products`.* FROM `products`
Variant Load (0.4ms) SELECT `variants`.* FROM `variants` WHERE `variants`.`is_master` = 0 AND `variants`.`product_id` = 1
Detail Load (2.4ms) SELECT `details`.* FROM `details` WHERE `details`.`product_id` = 1 AND `details`.`translation_token` = 'Salto/Tamanho' ORDER BY `details`.`id` DESC LIMIT 1
Detail Load (0.7ms) SELECT `details`.* FROM `details` WHERE `details`.`product_id` = 1 AND `details`.`translation_token` = 'Salto/Tamanho' ORDER BY `details`.`id` DESC LIMIT 1
Detail Load (1.5ms) SELECT `details`.* FROM `details` WHERE `details`.`product_id` = 1 AND `details`.`translation_token` = 'Categoria' ORDER BY `details`.`id` DESC LIMIT 1
Detail Load (0.6ms) SELECT `details`.* FROM `details` WHERE `details`.`product_id` = 1 AND `details`.`translation_token` = 'Categoria' ORDER BY `details`.`id` DESC LIMIT 1
Variant Load (0.5ms) SELECT `variants`.* FROM `variants` WHERE `variants`.`product_id` = 1 AND `variants`.`is_master` = 1 LIMIT 1
$("#products .product_container").each(function(index) {
if($(this).find("ul").html() == "") {
switch(index) {
case "1" :
<% position = 1 %>
break;
case "2" :
<% position = 2 %>
break;
default :
@raulsouzalima
raulsouzalima / ux_referencias
Created April 6, 2012 22:20 — forked from eshiota/ux_referencias
UX para Developers - Referências
# UX para Developers - Referências
## Soluções prontas
- Bootstrap from Twitter (http://twitter.github.com/bootstrap)
- jQuery Mobile (http://www.jquerymobile.com)
- HTML 5 Boilerplate (http://html5boilerplate.com)
## Ferramentas
<div id="menu">
<ul>
<li><a href="#">Artigos</a></li>
<li><a href="#">Peças</a></li>
</ul>
</div>