Bash script to:
- Iterate all commits made within a Git repository.
- List every object at each commit.
| #define __line_break_string__(s) #s | |
| NSString *str = @__line_break_string__( | |
| foo | |
| bar | |
| hello\nworld | |
| ); | |
| #undef __line_break_string__ | |
| /* | |
| foo bar hello |
| //Credit: https://stackoverflow.com/questions/1793882/how-to-make-a-macro-that-can-take-a-string | |
| #define STRINGIFY2(x) #x | |
| #define STRINGIFY(x) STRINGIFY2(x) | |
| #define PASTE2(a, b) a##b | |
| #define PASTE(a, b) PASTE2(a, b) | |
| #define PRINTTHIS(text) \ | |
| NSLog(PASTE(@, STRINGIFY(text))); | |
| //Result |
| BOOL foo = YES; | |
| id a = @(foo); | |
| //className: __NSCFBoolean | |
| id b = @(YES); | |
| //className: __NSCFBoolean | |
| id c = foo ? @(YES) : @(NO); | |
| //className: __NSCFBoolean |
| function fetchTimeout(url: string, init?: RequestInit, timeout = 5000): Promise<unknown> { | |
| return Promise.race([ | |
| fetch(url, init), | |
| new Promise((_, reject) => setTimeout(() => reject(), timeout)) | |
| ]); | |
| } |
| // Author: SerKo (https://github.com/serkodev) | |
| function group(cls, sel) { | |
| return function parse(cls, sel) { | |
| if (typeof cls == "string") { | |
| return cls.split(/\s/).reduce((a, cur) => cur ? a.concat(cur + sel) : a, []); | |
| } else if (typeof cls == "object") { | |
| return cls.reduce((a, cur) => a.concat(...parse(cur, sel)), []); | |
| } else return []; | |
| }(cls, sel || "").join(" "); |
| function calculateAlpha(bgColor, srcColor, finalColor) { | |
| // Convert a hex color to its rgb components | |
| function hexToRgb(hex) { | |
| const bigint = parseInt(hex.replace("#", ""), 16); | |
| return { | |
| r: (bigint >> 16) & 255, | |
| g: (bigint >> 8) & 255, | |
| b: bigint & 255, | |
| }; | |
| } |
| # archive folder including uncommit files | |
| git ls-files --others --exclude-standard --cached | zip --names-stdin archive.zip |
After 3 months of work, we're excited to announce the official release of Vue Language Tools v3.2.
Since the release of v3.1, we've introduced 20+ new features and delivered 70+ bug fixes. We’re covering a selection of highlights here, for the full details, please refer to the complete changelog on GitHub.