Skip to content

Instantly share code, notes, and snippets.

View lucasrenan's full-sized avatar

Lucas Renan lucasrenan

View GitHub Profile
@lucasrenan
lucasrenan / description.md
Last active August 23, 2018 17:53
Dumb postgres query comparison between int4/varchar

This is a complete naive comparison, don't take it for granted!

Docker for MAC: Version 18.06.0-ce-mac70 (26399)

Image: postgres:9.4.10-alpine

Results

Postgres did a sequence scan for both queries with and without indexes.

@lucasrenan
lucasrenan / docker.sh
Created August 4, 2018 13:28
Running snowplow on Docker (self reminder)
docker run \
-v ${PWD}/config:/snowplow/config \
-p 8000:8000 \
-e 'SP_JAVA_OPTS=-Xms512m -Xmx512m' \
-e 'GOOGLE_APPLICATION_CREDENTIALS=/snowplow/config/gcp-key.json' \
snowplow-docker-registry.bintray.io/snowplow/scala-stream-collector-google-pubsub:0.13.0 \
--config /snowplow/config/config.hocon
<table class="table">
<caption>Optional table caption.</caption>
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
{
"bold_folder_labels": true,
"color_scheme": "Packages/Solarized Color Scheme/Solarized (dark).tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
class BaseUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def extension_white_list
%w(jpg jpeg gif png)
end

Intern Developer

Job description

Learn fast, not only programming but all the facets of the industry.

Write efficiently clear and maintainable code.

Work in self-managed cells and develop projects for startups or well stabilished companies.

class Device
CONSUMPTIONS = {
"1" => { method_id: 2, value: 20 },
"2" => { method_id: 6, value: 0.001 },
"3" => { method_id: 7, value: 30 }
}
end
puts Device::CONSUMPTIONS["2"][:method_id] # => 6
puts Device::CONSUMPTIONS["2"][:value] # => 0.001
def products_path
"/products"
end
def product_path(id)
"/products/#{id}"
end
def dic
{
module Foo
def self.included(base)
base.extend(ClassMethods)
# alternative
def base.class_name
"class method name"
end
end
PagSeguroDirectPayment.setSessionId('session_id from backend');
PagSeguroDirectPayment.getInstallments({
amount: 50.00,
brand: "visa",
success: function(response) {
console.log("installments:");
console.log(response);
},
error: function(response) {