Skip to content

Instantly share code, notes, and snippets.

import React, { useState, useEffect } from "react";
import axios from "axios";
import { Card, Input } from "semantic-ui-react";
export default function Posts() {
const [APIData, setAPIData] = useState([]);
console.log(APIData);
const [searchInput, setSearchInput] = useState("");
useEffect(() => {
axios.get(`https://jsonplaceholder.typicode.com/users`).then((response) => {
setAPIData(response.data);
import React, { useState, useEffect } from "react";
import axios from "axios";
import { Card, Input } from "semantic-ui-react";
export default function Posts() {
const [APIData, setAPIData] = useState([]);
console.log(APIData);
const [searchInput, setSearchInput] = useState("");
useEffect(() => {
axios.get(`https://jsonplaceholder.typicode.com/users`).then((response) => {
setAPIData(response.data);
import React, { useState, useEffect } from "react";
import { GoogleMap } from "@react-google-maps/api";
import {
DirectionsService,
DirectionsRenderer,
Polyline,
} from "@react-google-maps/api";
const data = [
{
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { SignUpForm } from "./SignUpForm";
import { Provider } from "react-redux";
import { createStore } from "redux";
import { MemoryRouter } from "react-router";
import { reducer } from "../redux/reducer";
const initialValues = {
email: "",
// Coding exercise:
// Complete the function getLessonsByStatus.
// That function should return all lessons grouped by the progress status for the requested userId.
// There is a commented example of what the function might return.
// You will get data from the getLessons and getProgress function.
// There are commented examples of what each function might return on success.
// Please explain your logic as you write code.
// The code does not need to run, but should be logically sound.
import { useState, useEffect } from "react";
import axios from "axios";
import IssuesComponent from "./IssuesComponent";
import { IState, Issue } from "./Types";
import CardComponent from "./CardComponent";
import FilterForm from "./FilterForm";
import PaginationComponent from "./PaginationComponent";
import { Form } from "react-bootstrap";
const BaseUrl = "https://api.github.com/repos/";
@KravMaguy
KravMaguy / issues.tsx
Created July 12, 2021 20:32
issues component
import { Card, Badge, Button } from "react-bootstrap";
export interface IProps {
issues: {
title : string,
id : string,
repository_url : string,
html_url : string,
user:{
html_url : string,
@KravMaguy
KravMaguy / gist:0ac5bc4b528ffe8296ecc66a0a446517
Created June 29, 2021 20:09
max recurring element two ways
const globalArr = [
1, 3, 0, -10, -10, 4, 4, 4, 4, 4, 4, 4, 0, -10, 4, -10, 0, -3,
];
const loggResult = (el, count) =>
console.log(
`the most frequent value is ${el} occuring ${count} times in the array`
);
const findMaxRecurring = (array) => {
@KravMaguy
KravMaguy / srs
Last active May 12, 2021 20:23
gtag wordpress contact form 7 track form submission
<!DOCTYPE html>
<html lang="en-US">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-115893469-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-115893469-1');
@KravMaguy
KravMaguy / functions.php
Created May 6, 2021 21:35
php only post
<?php
include 'secrets.php';
add_action( 'wpcf7_mail_sent', 'cf7_form_send_to_acculynx' );
function cf7_form_send_to_acculynx($contact_form) {
$submission=WPCF7_Submission::get_instance();
if($submission){
$posted_data=$submission->get_posted_data();
$name=$posted_data['your-name'];
$email=$posted_data['your-email'];