Skip to content

Instantly share code, notes, and snippets.

class TopBarNotification extends Component {
render() {
return this.props.notifications.map((notification) => {
return <Notification {...notification} />
})
}
}
class App extends Component {
render() {
return <TopBarNotification />
}
}
class TopBarNotification extends Component {
render() {
return <Notification />
}
class App extends Component {
state = { notifications: [] }
render() {
return <TopBarNotification {...this.state} />
}
}
class App extends Component {
state = { notifications: [] }
}
@norbajunior
norbajunior / form_steps.rb
Created July 28, 2016 10:32 — forked from emk/form_steps.rb
Fill in multiline forms with Cucumber and Webrat
# Fill in multiple form fields using a table. Use it as follows:
#
# When I fill in the fields
# | Field 1 | Value 1 |
# | Field 2 | Value 2 |
When /^I fill in the fields$/ do |table|
table.rows_hash.each {|field, value| fill_in field, :with => value }
end
class RadioOption extends React.Component {
static propTypes = {
label: React.PropTypes.string.isRequired,
inputHtml: React.PropTypes.object,
wrapperHtml: React.PropTypes.object,
labelHtml: React.PropTypes.object,
labelAttribute: React.PropTypes.string,
idAttribute: React.PropTypes.string,
disableOptions: React.PropTypes.array,
options: React.PropTypes.array
@norbajunior
norbajunior / doc.md
Created July 15, 2016 16:57 — forked from oelmekki/doc.md
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

class Patient::Entrance < Salus::Model
# ja tinha no model
has_many :medical_cares, foreign_key: :patient_entrance_id
# ja tinha no model
has_one :first_medical_care,
class_name: 'MedicalCare',
foreign_key: :patient_entrance_id,
order: MedicalCare.arel_table[:id].asc
MedicalCare
.select([
MedicalCare.arel_table[:created_at],
MedicalCare.arel_table[:triage_entrance_id],
Sigtap::Occupation.arel_table[:name],
Person.arel_table[:name].as('person_name'),
Person.arel_table[:mother].as('person_mother'),
Person.arel_table[:birthdate].as('person_birthdate'),
])
.joins(:occupation, patient: :person)
<!DOCTYPE html>
<html>
<head>
<style>
#photo {
filter: alpha(opacity = 0);
position: fixed;
top: -100em;
}
</style>