This file contains hidden or 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 Produto | |
attr_accessor :nome, :categoria, :preco, :estoque | |
def initialize(nome:, categoria: 'Geral', preco:, estoque:) | |
@nome = nome | |
@categoria = categoria | |
@preco = preco | |
@estoque = estoque | |
end | |
end |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import './App.css'; | |
import { BrowserRouter as Router, Route } from "react-router-dom"; | |
import SearchBar from './components/SearchBar' | |
import ItemList from './components/ItemList' | |
class App extends Component { | |
state = {items: []} |
This file contains hidden or 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
$rollout.set_feature_data(:chat, description: 'foo', release_date: 'bar', whatever: 'baz') | |
$rollout.define_group(:fiveonly) do |user| | |
user.id == 5 | |
end | |
$rollout.activate_group(:chat, :fiveonly) | |
$rollout.active?(:chat, User.find(5)) # => this returns true |
This file contains hidden or 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
def default_grade | |
return nil unless grades | |
return '7' if grades.include?('7') | |
grades.first | |
end | |
def default_grade | |
((['7'] & grades) + grades).first | |
end |
This file contains hidden or 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
export const elipsisTetx(text) => | |
text.length < 35 ? text : `${text.substring(0, 35)}...` |
This file contains hidden or 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
puts 'hello world' |
This file contains hidden or 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
### using 1 model for modules | |
class CercaModule | |
has_many: sugestions | |
has_many: lessons | |
# attributes: lesson_module_type # "collection_module" || "lesson_module" | |
end | |
class Sugestion |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.item1 { grid-area: header; } | |
.item2 { grid-area: menu; } | |
.item3 { grid-area: main; } | |
.item4 { grid-area: right; } | |
.item5 { grid-area: footer; } |
This file contains hidden or 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
logo |
This file contains hidden or 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
defmodule Greeter do | |
def factorial(number) do | |
total = 1 | |
if number > 1 do | |
total = number * factorial(number - 1) | |
else | |
number | |
end | |
total | |
end |
NewerOlder