essas batalhas sobre linguagens de programação sao frequententes, mas muitos ignoram que tudo vira instruções que a máquina é capaz de executar então, no inicio, a programação era complicada, com fios (isso falando de computadores modernos, da época da segunda guerra depois, com o desenvolvimento das memórias, viu-se a vantagem de tornar a programação flexivel e armazena-la na memoria (agora abundante) os computadores e os programas começaram a crescer entao eles programavam apenas em código de máquina, instruções que eram codificadas para cada processador depois veio a ideia de agrupar instrucoes semelhantes em menemonicos aparece o assembly uma instrucao em assembly pode gerar varias instrucoes de maquina diferente mov Registrador, memoria mov memoria, Registrador
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I am assuming you have a User model with a | |
# has_many :people association? | |
def create | |
# Your params for Person creation are found on the params[:person] | |
# I do not understand what you are doing here. Basically, what's going | |
# on - if an organisation is selected, you are building the person off of | |
# the organisation relationship. Your form, however, revolves around people, not | |
# organisations. | |
# So, get rid of the complexity below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= BootstrapLinkRenderer | |
super.try :html_safe | |
end | |
class BootstrapLinkRenderer < LinkRenderer | |
protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
# | |
# Rodrigo Soares Manhães, professor homenageado pelos formandos da turma de 2007 | |
# do curso de Ciência da Computação da UENF. | |
# | |
# 20/09/2012 | |
# | |
## | |
class Aluno < ActiveRecord::Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Carrinho | |
def initialize | |
@itens = [] | |
end | |
def incluir(produto) | |
@itens << ItemCarrinho.new(produto) | |
end | |
def remover(produto) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'Expectation Matchers' do | |
describe 'equivalence matchers' do | |
it 'will match loose equality with #eq' do | |
a = "2 cats" | |
b = "2 cats" | |
expect(a).to eq(b) | |
expect(a).to be == b # synonym for #eq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.source.ruby': | |
'describe (String)': | |
'prefix': 'des' | |
'body': 'describe "${1:subject}" do\n $0\nend' | |
'describe (type)': | |
'prefix': 'dest' | |
'body': 'describe ${1:Type} do\n $0\nend' | |
'describe (type, string)': | |
'prefix': 'dests' | |
'body': 'describe ${1:Type}, "${2:description}" do\n $0\nend' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/mock' | |
require 'minitest/unit' | |
require 'date' | |
MiniTest::Unit.autorun | |
class TestMailPurge < MiniTest::Unit::TestCase | |
class MailPurge | |
def initialize(imap) | |
@imap = imap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# Put this code snippet between the <head></head>-tags in your application layout and %> | |
<%# replace 'UA-XXXXXXXX-X' with your own unique Google Analytics Tracking ID %> | |
<%# ... %> | |
<head> | |
<%# ... %> | |
<% if Rails.env.production? %> | |
<script type="text/javascript"> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
OlderNewer