Skip to content

Instantly share code, notes, and snippets.

View lucasrenan's full-sized avatar

Lucas Renan lucasrenan

View GitHub Profile
var App = App || {};
App.ac_appender = {
/*
* ========================================
*
* requires jquery autocomplete
*
* ========================================
---
layout: project
title: "Project 1"
subtitle: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diamsit e nonummy nibh euismod tincidunt ut laoreet magna aliquam."
date: 2014-09-05 17:49:49
categories: projects
description: "Descrição do projeto no thumbnail com mouse over consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore lorem ipsum sit dolor amet hyperlink aliquam erat volutpat. Ut wisi enim ad minim veniam, veniam, quis nostrud exerci tation aliquip ex ea commodo consequat."
authors: ["lionelmessi", "cristianoronaldo", "frankribery"]
---
@lucasrenan
lucasrenan / gist:ec726b9f1b2b9ef1e01b
Created October 17, 2014 03:57
brazilian states by region
STATES = {
REGION_SOUTH => ['PR', 'RS', 'SC'],
REGION_SOUTHEAST => ['ES', 'MG', 'RJ', 'SP'],
REGION_MIDWEST => ['DF', 'GO', 'MT', 'MS'],
REGION_NORTH => ['AC', 'AM', 'AP', 'PA', 'RO', 'RR', 'TO'],
REGION_NORTHEAST => ['AL', 'CE', 'BA', 'MA', 'PB', 'PE', 'PI', 'RN', 'SE']
}
require 'rails_helper'
feature 'authentication' do
let!(:user) { create(:user, password: '12345678', password_confirmation: '12345678') }
before do
visit root_path
fill_in :user_email, with: user.email
fill_in :user_password, with: '12345678'
click_button 'Sign in'
{
"auto_completecommiton_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
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) {
module Foo
def self.included(base)
base.extend(ClassMethods)
# alternative
def base.class_name
"class method name"
end
end
def products_path
"/products"
end
def product_path(id)
"/products/#{id}"
end
def dic
{
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
@lucasrenan
lucasrenan / gist:774330
Created January 11, 2011 11:45
ActsAsLogger 0.1
module ActsAsLogger
module Logger
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_logger(options={})
include InstanceMethods