Skip to content

Instantly share code, notes, and snippets.

View SimoneCheng's full-sized avatar
👻
Weee!!!

Simone SimoneCheng

👻
Weee!!!
View GitHub Profile
@SimoneCheng
SimoneCheng / .zshrc
Last active May 24, 2022 07:46
my .zshrc
alias git='LANG=en_GB git'
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats '(%b)'
# Set up the prompt (with git branch name)
@SimoneCheng
SimoneCheng / .vimrc
Created April 28, 2022 03:54
my .vimrc
syn on "语法支持
set laststatus=2 "始终显示状态栏
set tabstop=2 "一个制表符的长度
set softtabstop=2 "一个制表符的长度(可以大于tabstop)
set shiftwidth=2 "一个缩进的长度
set expandtab "使用空格替代制表符
set smarttab "智能制表符
set autoindent "自动缩进
set smartindent "只能缩进
set number "显示行号
@SimoneCheng
SimoneCheng / javascript_deep_dive.md
Created August 14, 2023 04:08 — forked from faressoft/javascript_deep_dive.md
JavaScript Deep Dive to Crack The JavaScript Interviews
@SimoneCheng
SimoneCheng / dom_performance_reflow_repaint.md
Created August 14, 2023 04:08 — forked from faressoft/dom_performance_reflow_repaint.md
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@SimoneCheng
SimoneCheng / xterm-256color.md
Created March 22, 2024 16:26 — forked from shawnbot/xterm-256color.md
Make OS X Terminal respect 256 colors in screen

1. Ensure that Terminal declares itself as "xterm-256color"

Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color.

2. Build a version of screen that supports 256 colors

This is easy with homebrew:

brew install screen
#include <stdio.h>
#include <stdlib.h>
typedef struct Student {
int studentID;
double GPA;
struct Student* next; /* problem 1-1 */
} Student_t;
void printStudentInfo(Student_t* current) {
#include <stdio.h>
float f1(int a, int b) {
return (float) b/a + b%a;
}
int f2() {
enum MONTH { Jan, Feb = 2, Mar, Apr, May, Jun = 9, Jul };
return (Jun/Apr + May%3 + Jan*Jul);
}
# (1)
def check(x, data: dict, label: dict):
if len(x) == 0: return
for key, value in label.items():
if x[0] in value and x[0] in label['num']:
data['num'] += int(x[0]) + 1
elif x[0] in value: data[key] += 2
return check(x[1:], data, label)
def countSymbol():
@SimoneCheng
SimoneCheng / 113-NTUT-problem-04.cpp
Last active December 8, 2024 04:31
113-NTUT-problem-04.cpp
#include <iostream>
#include <string>
using namespace std;
class Shape {
protected:
string c; // color
int w; // weight
public: