Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Focusing

阿瑜 goish135

:octocat:
Focusing
View GitHub Profile
@goish135
goish135 / tool-transform.py
Created Feb 10, 2022
app.config to paas import excel
View tool-transform.py
# 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 Feb 7, 2022
Bob team: me & Jason
View dBob.py
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 Jan 12, 2022
Java Streams Example
View Cat.java
package mycat;
public class Cat {
private String name;
private String weight;
// Getter
public String getName() {
return name;
}
View avoid_duplicate.js
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
View forLoop-async_await.js
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')
}
View app.js
const mongoose = require('mongoose')
const {model,Schema} = require('mongoose')
mongoose.connect('mongodb://localhost:27017/myapp',{useNewUrlParser:true});
const app = require('express')()
const DepartmentSchema = new Schema({
name: String,
location: String
}
)
View app.js
const express = require("express");
const app = express();
const mongoose = require("mongoose");
const bodyParser = require("body-parser");
const session = require("express-session");
const flash = require("connect-flash");
const moment = require("moment");
const seedDB = require("./seed");
const removeUsers = require("./remove");
View YT2mp3.py
# -*- coding: utf-8 -*-
#from pytube import YouTube
#url = 'https://youtu.be/Ej83dvkU-Z4'
#YouTube(url).streams.first().download()
# -*- coding: utf-8 -*-
from moviepy.editor import *
View b-9.cpp
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<=7;i++)
{
for(int j=1;j<=7;j++)
{
if(!(i>=3&&i<=5)&&!(j>=3&&j<=5)&&!((i==1||i==7)&&(j==1||j==7)))
{
View table-1.java
List<String> strings = list.stream().map(object -> Objects.toString(object,null)).collect(Collectors.toList());
// table 1
// 有 A 才有 B