Skip to content

Instantly share code, notes, and snippets.

View rafaelss's full-sized avatar

Rafael Souza rafaelss

View GitHub Profile
// node promise.js
function Promise() {
this.callbacks = [];
this.resolved = false;
this.resolve = function(value) {
if(this.resolved) {
throw "Promise already resolved";
}
else {

I've been working with web development since 2001, the last 4 years using Ruby full-time. Before that I've worked with PHP, Java and .NET.

Currently I work as Ruby developer at Vnda (vnda.com.br), using Ruby, Rails, Sinatra and PostgreSQL. Also Javascript, CSS, Redis, Memcached and Solr. Vnda is a SaaS E-commerce Platform, focused on brazilian market, that runs on Amazon AWS.

I'm looking for an oportunity that allows me keep working with Ruby and also learn new stuff and experiment new ways of work.

My GitHub is http://github.com/rafaelss and my LinkedIn is http://linkedin.com/in/rafaelss

@rafaelss
rafaelss / gist:7217245
Last active December 26, 2015 21:39
Desenvolvedor Front-end remoto na Vnda

Estamos a procura de desenvolvedor remoto com foco em front-end para implementar e manter as lojas dos nossos clientes. Precisa saber HTML, CSS e Javascript. Já ter trabalhado com alguma linguagem de template é um plus, ainda mais se essa linguagem for Liquid.

Aqui na Vnda utilizamos Ruby, Rails/Sinatra e PostgreSQL, mas o conhecimento dessas tecnologias não é obrigatório.

Se estiver afim de trocar uma ideia, mande um e-mail para reis@vnda.com.br.

{% assign available_variants = "|" %}
{% for variant in product.variants %}
{% if variant.available %}
{% assign available_variants = available_variants | append: "|" | append: variant.attributes.size %}
{% endif %}
{% endfor %}
{{ available_variants | remove_first: "|" | split: "|" }}
@rafaelss
rafaelss / gist:5224882
Last active December 15, 2015 07:39
SublimeText2 User Preferences
{
"auto_complete": false,
"bold_folder_labels": true,
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"detect_indentation": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Droid Sans Mono",
"font_size": 14,
"highlight_line": true,
PATH="/Users/rafael/rubies/`cat /Users/rafael/rubies/current`/bin:$GOPATH/bin:/usr/local/share/python:$PATH"
@rafaelss
rafaelss / gist:3700977
Created September 11, 2012 19:04
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. pg_ctl -D /usr/local/var/postgres stop -s -m fast
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
class A
def foo
case true
when true
puts defined?(bar)
puts "nil? #{bar}"
when false
bar = "something else"
raise "here? no"
end
class Code
def initialize(code)
@code = code
end
def process
parse(transform(@code))
end
def transform(code)
class MyDecorator
attr_accessor :view_context
def form(&block)
view_context.form_for(TheModel.new, &block)
end
end