Skip to content

Instantly share code, notes, and snippets.

View siakaramalegos's full-sized avatar
🦄

Sia siakaramalegos

🦄
View GitHub Profile
@siakaramalegos
siakaramalegos / BasicControlledForm.js
Last active October 26, 2017 20:47
Basic controlled inputs form
import React, { Component } from 'react'
export default class BasicControlledForm extends Component {
constructor() {
super()
// Initialize the values for our input properties with empty strings
this.state = {
firstName: '',
spiritAnimal: '',
}
@siakaramalegos
siakaramalegos / basic_router.jsx
Last active July 6, 2023 04:02
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';
@siakaramalegos
siakaramalegos / ControlledVsUncontrolledForms.js
Last active December 15, 2020 12:39
Controlled vs Uncontrolled/Serialized Forms in React
import React, {Component} from 'react'
import serialize from 'form-serialize'
export class FrontEndPartyControlled extends Component {
static defaultProps = {
name: '',
spiritAnimal: '',
}
constructor(props) {
@siakaramalegos
siakaramalegos / Document.es6
Created October 6, 2016 20:48
Updating style based on button click in React
import React, {Component, PropTypes} from 'react'
import View from './View'
import Button from '../common/Button'
export default class Document extends Component {
static propTypes = {
program: PropTypes.object.isRequired,
}
constructor() {
@siakaramalegos
siakaramalegos / index.html
Created July 25, 2016 01:45
Flexbox demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>Header</header>
@siakaramalegos
siakaramalegos / index.html
Created June 12, 2016 15:01
react-getting-started-game
<div id="container" class="container"></div>
@siakaramalegos
siakaramalegos / index.html
Created June 12, 2016 00:37
react-getting-started-github
<div id="root"></div>
# Path to your oh-my-zsh installation.
export ZSH=/Users/sia1/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@siakaramalegos
siakaramalegos / imperial_to_metric.rb
Created January 20, 2016 16:40
Imperial to Metric program
# Defining my methods at the top so I can use them later
# Ask user for their name
def get_name
puts "Hellooo there, what is your name?"
gets.chomp
end
# Ask the user for their height in inches
def get_height_inches(user_name)
@siakaramalegos
siakaramalegos / restaurant-style.css
Created October 28, 2015 16:09
Learning CSS with restaurant page
body {
/*color: blue;*/
font-family: Arial, Helvetica;
background: url("burgers.jpeg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}