Skip to content

Instantly share code, notes, and snippets.

View hyoban's full-sized avatar
🤩
Waiting for the next chapter

Stephen Zhou hyoban

🤩
Waiting for the next chapter
View GitHub Profile
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedContentScope
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.keyframes
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.animation.with
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.EnterExitState
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.animateColor
import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@hyoban
hyoban / layout.kt
Created November 15, 2021 13:23
jetpack custom layout example
@Composable
fun MyColumn(
modifier: Modifier = Modifier,
content: @Composable () -> Unit,
) {
Layout(
// apply modifier to layout
modifier = modifier,
// slot for any child composables
@hyoban
hyoban / .zshrc
Last active January 9, 2022 17:17
zsh 设置
alias ll='ls -al'
# fix pip command in zsh
alias pip='noglob pip'
# set proxy
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
@hyoban
hyoban / .ipynb
Created October 19, 2021 07:52
学生成绩分类
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "学生成绩分类",
"provenance": [],
"toc_visible": true,
"authorship_tag": "ABX9TyNDT9c9JZD+l0wV/bhTLPUK",
"include_colab_link": true
@hyoban
hyoban / ResponseAdvisor.kt
Last active October 6, 2021 06:28
Spring Boot 处理统一返回结果和异常
/**
* 处理统一返回结果和异常
*/
@RestControllerAdvice
class ResponseAdvisor : ResponseBodyAdvice<Any> {
data class Result<T>(
val status: Int = HttpStatus.OK.value(),
val message: String = "成功",
val data: T? = null,
@hyoban
hyoban / main.py
Created October 1, 2021 13:58
波士顿房价分析,机器学习作业
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from sklearn.datasets import load_boston
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import mean_squared_error, mean_absolute_error
from sklearn.model_selection import train_test_split, learning_curve, ShuffleSplit
@hyoban
hyoban / main.go
Created September 24, 2021 05:41
监听文件夹自动上传到 hdfs
package main
import (
"context"
"database/sql"
"flag"
"log"
"os"
"os/exec"
"strconv"
@hyoban
hyoban / main.py
Created September 11, 2021 02:00
考勤统计
from typing import List
import pandas as pd
student_number_conversion = {}
def change_number(pre: str) -> str:
if pre in student_number_conversion.keys():
return student_number_conversion[pre]