Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Front End Development / React</title>
</head>
<body>
<!-- We will put our React component inside this div. -->
<div id="root"></div>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>React getting started</title>
</head>
<body>
<!-- Root container for react components -->
<div id="root"></div>
@juhahinkula
juhahinkula / reactNasa.html
Last active February 13, 2018 13:02
NASA APOD API usage with React
<!-- Fetch astronomy picture of the day from NASA API -->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>React getting started</title>
</head>
<body>
<!-- Root container for react components -->
<div id='root'></div>
@juhahinkula
juhahinkula / reactNasaBootstrap-html
Last active September 19, 2017 17:34
NASA APOD api usage with react and bootsrap
<!-- Fetch astronomy picture of the day from NASA API -->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>React getting started</title>
</head>
<body>
<!-- Root container for react components -->
<div id='root'></div>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>React getting started</title>
</head>
<body>
<!-- Root container for react components -->
<div id='root'></div>
@juhahinkula
juhahinkula / Todolist.js
Last active March 22, 2023 11:11
Simple todolist made with create-react-app. Gist contains the App.js code
import { useState } from 'react';
function TodoList() {
const [desc, setDesc] = useState('');
const [todos, setTodos] = useState([]);
const inputChanged = (event) => {
setDesc(event.target.value);
}
@juhahinkula
juhahinkula / SpringBootCorsFilter
Created October 13, 2017 11:26
CORS filter for Spring Boot
mport java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
@Component
public class CorsFilter extends OncePerRequestFilter {
@juhahinkula
juhahinkula / index.html
Created October 30, 2017 10:35
React front to spring boot example
<!DOCTYPE html>
<html>
<head>
<title>React + Spring</title>
</head>
<body>
<div class='container'>
<div id='root'></div>
@juhahinkula
juhahinkula / App.js
Last active February 12, 2024 07:39
Github jobs React Native example (App.js code)
import { useState } from 'react';
import { StatusBar } from 'expo-status-bar';
import { Alert, StyleSheet, Text, View, Button, TextInput, FlatList } from 'react-native';
export default function App() {
const [keyword, setKeyword] = useState('');
const [repositories, setRepositories] = useState([]);
const getRepositories = () => {
fetch(`https://api.github.com/search/repositories?q=${keyword}`)
@juhahinkula
juhahinkula / App.js
Last active February 22, 2024 11:56
React Native SQLite Courselist
import { useState, useEffect } from 'react';
import { StyleSheet, Text, TextInput, View, Button, FlatList } from 'react-native';
import * as SQLite from 'expo-sqlite';
const db = SQLite.openDatabase('coursedb.db');
export default function App() {
const [credit, setCredit] = useState('');
const [title, setTitle] = useState('');
const [courses, setCourses] = useState([]);