Skip to content

Instantly share code, notes, and snippets.

View bigeyex's full-sized avatar

Yu Wang bigeyex

  • ByteDance
  • Beijing, China
View GitHub Profile
from tkkit import *
from shutil import copytree
import fitz
from PIL import Image
import re
import os
app = TKApp('My App')
def on_change_content():
return UpdateElement('detail_card', content=[
DetailGroup('Refund Request', content=[
DetailItem('Ordre No.', 1100000),
DetailItem('Status', "Fetched"),
DetailItem('Shipping No.', 1234567),
DetailItem('Sub Order', 1135456)
]),
])
@app.page('/', 'Dashboard')
def form_page():
return [
Row([
Column([
ChartCard('Total Sales', '$126,560', 'The total sales number of xxx', height=50,
content=[BarChart(visit_data, show_axis=False, height=50)],
footer=[Statistic('Daily Sales', '$12423', inline=True)])
]),
Column([
@bigeyex
bigeyex / adminui_menu_example.py
Created March 1, 2020 06:11
AdminUI menu example
app.set_menu(
[
MenuItem('home', '/', icon="dashboard"),
MenuItem('User Home', '/user_home', icon="dashboard", auth_needed='user', children=[
MenuItem('New Item', '/new', icon="plus"),
MenuItem('Search for Item', '/search', icon="search", auth_needed='admin'),
MenuItem('Admin', '/admin', icon="setting")
]),
MenuItem('Admin Only', '/', icon="dashboard", auth_needed='admin', children=[
MenuItem('New Item', '/new', icon="plus"),
@bigeyex
bigeyex / adminui_example_basic.py
Created March 1, 2020 05:37
A basic example of AdminUI
from adminui import *
app = AdminApp()
def on_submit(form_data):
print(form_data)
@app.page('/', 'form')
def form_page():
return [
@bigeyex
bigeyex / bolipolate.py
Last active February 22, 2020 07:04
jupyter notebook bolipolate
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
plt.rcParams['font.sans-serif']=['SimHei'] # for displaying Chinese characters correctly
plt.rcParams['axes.unicode_minus']=False # for displaying the minus sign correctly
df = pd.read_excel('E:\Work\path_to_excel_file.xlsx')
@bigeyex
bigeyex / bolipolate.ipynb
Created February 22, 2020 07:03
jupyter notebook bolipolate
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bigeyex
bigeyex / MBFlipImageView.h
Created January 7, 2016 10:32
"Extended UI Kit"
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface MBFlipImageView : UIImageView
@property (nonatomic) IBInspectable UIImage *onImage;
@property (nonatomic) IBInspectable UIImage *offImage;
- (void)flipOn;
- (void)flipOff;
@bigeyex
bigeyex / UIColor+HexString.h
Created December 18, 2015 12:40
UIClolor+HexString: Create your UIColor from a "css color code" style hex string
#import <Foundation/Foundation.h>
@interface UIColor (HexString)
+ (UIColor *) colorFromHexString:(NSString *)hexString;
@end
@bigeyex
bigeyex / UIColor+HexString.h
Created December 18, 2015 12:40
UIClolor+HexString: Create your UIColor from a "css color code
#import <Foundation/Foundation.h>
@interface UIColor (HexString)
+ (UIColor *) colorFromHexString:(NSString *)hexString;
@end