Skip to content

Instantly share code, notes, and snippets.

View goish135's full-sized avatar

阿瑜 goish135

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<!-- table tennis king -->
import './App.css';
import { Table,Button,Layout,Input} from 'antd';
import React, { useState,useRef } from 'react';
import ReactToPrint from "react-to-print";
import { PrinterOutlined } from '@ant-design/icons';
const { Header, Content, Footer } = Layout;
function App() {
REF: https://kentcdodds.com/blog/stop-being-a-junior
class TrieNode:
def __init__(self):
self.childen = {}
self.isEnd = False
self.refs = 0
def addWord(self,word):
cur = self
# cur.ref += 1
for w in word:
@goish135
goish135 / Import Export CSV.js
Created February 28, 2023 14:26
CSV Reader
// npm install react-csv --save;
// npm install papaparse
import React, { useState } from "react";
import { CSVLink } from "react-csv";
import Papa from "papaparse";
const App = () => {
const [tableRows, setTableRows] = useState([]);
@goish135
goish135 / tool-transform.py
Created February 10, 2022 17:06
app.config to paas import excel
# V Read every line in application.config
# V split each line using equal operator
# ---
# write to excel:
# Put key value to excel specified field
# & default value already wriien in excel
# ---
# [Note]
# Check it ...
@goish135
goish135 / dBob.py
Created February 7, 2022 03:41
Bob team: me & Jason
import sys
import os
import time
import platform
try:
name = sys.argv[1]
except:
print('Type python3 dancing_bob.py [Name]')
exit(1)
@goish135
goish135 / Cat.java
Created January 12, 2022 14:15
Java Streams Example
package mycat;
public class Cat {
private String name;
private String weight;
// Getter
public String getName() {
return name;
}
exports.addNewClass = async (req, reply) => {
try {
let classname = new class_name(req.body)
const className = req.body
console.log(className.class_name)
const duplicateData = await class_name.findOne({"class_name":className.class_name})
console.log("duplicateData:"+duplicateData)
if(!duplicateData){
let newclass = await classname.save()
return newclass
const forLoop = async _ => {
console.log('start');
for (let index = 0; index < fruitsToGet.length; index ++) {
const fruit = fruitsToGet[index];
const numFruit = await getNumFruit(fruit);
console.log(numFruit);
}
console.log('End')
}