Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Daniel Morales danielmoralesp

🎯
Focusing
View GitHub Profile
View javascript_objects.js
const myTeam = {
center: <li>Benzo Walli</li>,
powerForward: <li>Rasha Loa</li>,
smallForward: <li>Tayshaun Dasmoto</li>,
shootingGuard: <li>Colmar Cumberbatch</li>,
pointGuard: <li>Femi Billon</li>
};
View ruby_hash.rb
myPets = {
'dog': 'canine',
'cat': 'feline',
'donkey': 'asinine'}
View component.js
class MyComponentClass extends React.Component {
render(){
return <h1>Hello World</h1>
}
};
View ruby_class.rb
class MyRubyClass
def render
"Hello World"
end
end
View consctructor.js
class App extends Component {
constructor(props){
super(props)
this.state = { latitude: null, errorMessage: '' }
}
}
View ruby_initializer.rb
class Customer
def initialize(id, name, addr)
@cust_id = id
@cust_name = name
@cust_addr = addr
end
end
View handler_react.js
class App extends Component {
constructor(props){
super(props)
this.state = { lat: null, errorMessage: '' }
}
onMouseMove = (event) => {
this.setState({
styleOne: transform(-event.clientX / event.clientY),
View methods.rb
class Person
def initialize(name)
@name = name
end
def change_name=(other_name)
@name = other_name
end
end
View reactDOM.js
ReactDOM.render(
<App />,
document.getElementById('root')
);
...
ReactDOM.render(
<App name="Jhon Doe" />,
document.getElementById('root')
View ruby_object.rb
p1 = Person.new
puts p1.greet
...
p1 = Person.new("Jhon Doe")
puts p1.greet