Skip to content

Instantly share code, notes, and snippets.

View ariestikto's full-sized avatar

Pratikto Ariestyadi ariestikto

  • 03:20 (UTC +01:00)
View GitHub Profile
@ariestikto
ariestikto / App.jsx
Last active February 9, 2024 19:08
API call using Axios
import 'bootstrap/dist/css/bootstrap.min.css';
import { useEffect, useState } from 'react';
import axios from 'axios';
import Alert from 'react-bootstrap/Alert';
import Form from 'react-bootstrap/Form';
import Container from 'react-bootstrap/Container';
import Placeholder from 'react-bootstrap/Placeholder';
function App() {
// State for search input element
@ariestikto
ariestikto / App.jsx
Created February 1, 2024 20:10
03-Stu-Character-Gallery
import './App.css'
import CharacterGallery from './components/CharacterGallery'
function App() {
return (
<CharacterGallery />
);
}
export default App
  1. Go to Netlify and either log in or sign up for an account.
    • Signing up:
      • Click the "Sign up" button.
      • Select the "GitHub" button.
      • Authorize Netlify to have access to your GitHub.
    • Signing in:
      • Click the "Sign in" button.
      • Sign in whichever way you signed up before. step8
  2. Click the New site from Git button.
@ariestikto
ariestikto / App.jsx
Last active January 31, 2024 04:19
custom hooks
import 'bootstrap/dist/css/bootstrap.min.css';
import * as bootstrap from 'bootstrap';
import { useEffect, useState } from "react";
import axios from 'axios';
import useGroceries from './hooks/useGroceries';
function App() {
const {
search,
@ariestikto
ariestikto / App.jsx
Created January 31, 2024 04:17
useState with object as state variable
import { useState } from 'react';
import './App.css';
function App() {
const [profile, setProfile] = useState({
name: '',
age: 0,
});
return (
@ariestikto
ariestikto / App.jsx
Created January 31, 2024 04:15
useEffect with API call example
import 'bootstrap/dist/css/bootstrap.min.css';
import * as bootstrap from 'bootstrap';
import { useEffect, useState } from "react";
import axios from 'axios';
function App() {
const [search, setSearch] = useState('');
const [posterUrl, setPosterUrl] = useState(null);
@ariestikto
ariestikto / App.jsx
Created January 31, 2024 04:13
useEffect with multiple dependencies
import 'bootstrap/dist/css/bootstrap.min.css';
import * as bootstrap from 'bootstrap';
import { useEffect, useState } from "react";
import axios from 'axios';
import useGroceries from './hooks/useGroceries';
const groceryData = [
{ name: 'Milk', category: 'Drink' },
{ name: 'Bread', category: 'Food' },
mutation RemoveParticipants(
$requesterUserType: String!
$requesterUserId: Int!
$practitionerId: Int
$removedParticipants: [RemoveParticipantInput]!
) {
removeParticipants (
requesterUserType: $requesterUserType,
requesterUserId: $requesterUserId,
practitionerId: $practitionerId,
@ariestikto
ariestikto / components-Form-index.js
Last active January 25, 2024 20:28
02-Stu-FunWithForms
import React, { useState } from 'react';
import './style.css';
function Form() {
// Setting initial state to an object
const [formData, setFormData] = useState({ firstName: '', lastName: '', password: '' });
// formData = { firstName: '', lastName: '' }
const handleInputChange = (event) => {
// Getting the value and name of the input which triggered the change
@ariestikto
ariestikto / item.js
Created January 18, 2024 21:49
05-Ins-Multiple-Classes
class Item {
constructor(title, price) {
this.title = title;
this.price = price;
}
}
module.exports = Item;