Skip to content

Instantly share code, notes, and snippets.

View jzhang026's full-sized avatar

Adrian Zhang jzhang026

View GitHub Profile
// 中缀表达式求职
// leetcode 224 题
// https://leetcode.com/problems/basic-calculator/
/*
给你一个字符串表达式 s ,请你实现一个基本计算器来计算并返回它的值。
示例 1:
输入:s = "1 + 1"
输出:2
@jzhang026
jzhang026 / match.js
Last active February 21, 2023 09:26
this code checks if a css selectors matches a DOM elements
// parse complex css selectors, such as 'div#my-id.my-class.another-class[foo=bar]'
// let parser = new ParseComplexSelector();
// let selectors = parser.parse('div#my-id.my-class.another-class[foo=bar]')
// this will output:
// {
// tag: 'div',
// class: ['my-class', 'another-class'],
// attributes: {
// foo: bar
// }