Skip to content

Instantly share code, notes, and snippets.

View TangoPJ's full-sized avatar
🎯
Focusing

TangoPJ

🎯
Focusing
View GitHub Profile
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint"
}
import axios from "axios";
const getInfoFromGit = async (urls) => {
const response = [];
for (const url of urls) {
try {
const {
data: { stargazers_count, forks, name, html_url },
} = await axios.get(`https://api.github.com/repos/${url}`);
import Head from 'next/head'
import styles from '../styles/Home.module.css'
export default function Home() {
return (
<div className={styles.container}>
<Head>
<title>Home page</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
import Link from 'next/link'
import styles from './GithubRender.module.css'
import Fork from '../../images/fork.svg'
import Star from '../../images/star.svg'
import Image from 'next/image'
export const GithubRender = () => {
return (
<section className={styles.wrapper}>
<h1 className={styles.title}>
.wrapper {
background-color: #2f3660;
text-align: center;
padding-top: 48px;
padding-bottom: 48px;
}
.title {
color: #ebebeb;
letter-spacing: 2px;
import { Octokit } from "@octokit/core";
export const getInfoFromGit = async (urls) => {
const octokit = new Octokit({
auth: process.env.NEXT_PUBLIC_GITHUB_TOKEN,
})
const repositories = []
for (const url of urls) {
import Link from 'next/link'
import styles from './GithubRender.module.css'
import Fork from '../../images/fork.svg'
import Star from '../../images/star.svg'
import Image from 'next/image'
import { getInfoFromGit } from '../../api'
import { useEffect, useState } from 'react'
export const GithubRender = () => {
const [repos, setRepos] = useState([])
@TangoPJ
TangoPJ / gist:efb44601ac5e69ea2986c9a055ac9124
Created December 3, 2022 18:56
start_function_to_longest_common_prefix_string.js
const longestCommonPrefix = (strings) => {
if (strings.length === 1) {
return strings[0];
}
};
const longestCommonPrefix = (strings) => {
if (strings.length === 1) {
return strings[0];
}
const sortedStrings = strings.sort();
const first = sortedStrings.at(0).split('');
const last = sortedStrings.at(-1);
let result = '';
/**
* @param {string[]} strings
* @return {string}
*/
const longestCommonPrefix = (strings) => {
if (strings.length === 1) {
return strings[0];
}
const sortedStrings = strings.sort();