- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.gitsudo nano ~/.bash_profile
- Add
export PATH=/path/to/depot_tools:"$PATH"(it's important that depot_tools comes first here)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {number[][]} restaurants | |
| * @param {number} veganFriendly | |
| * @param {number} maxPrice | |
| * @param {number} maxDistance | |
| * @return {number[]} | |
| */ | |
| var filterRestaurants = function(restaurants, veganFriendly, maxPrice, maxDistance) { | |
| function isVeganFriendly(rest) { | |
| if (veganFriendly === 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| <script> | |
| function loadResource(links, fnSuccess, fnError) { | |
| var script = document.createElement('script'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| APP_NAME = Private Repo | |
| RUN_USER = git | |
| RUN_MODE = prod | |
| [database] | |
| DB_TYPE = mysql | |
| HOST = mysql.gogs.lab.com:3306 | |
| NAME = gogs | |
| USER = gogs | |
| PASSWD = gogs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DOCKER_GOGS_IMAGE=gogs/gogs:0.11.91 | |
| GOGS_DOMIAN=git.luojiyin.top | |
| DOCKE_MYSQL_IMAGE=mysql:5.7.16 | |
| MYSQL_HOST=mysql.gogs.lab.com | |
| DOCKER_REDIS_IMAGE=redis:5.0-alpine | |
| REDIS_HOST=cache.gogs.lab.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.6' | |
| services: | |
| gitea: | |
| image: gitea/gitea:1.10.3 | |
| environment: | |
| - USER_UID=1000 | |
| - USER_GID=1000 | |
| - APP_NAME=Private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {number[]} nums | |
| * @param {number} target | |
| * @return {number[]} | |
| */ | |
| var searchRange = function(nums, target) { | |
| const left = lowerBound(nums, target); | |
| const right = upperBound(nums, target); | |
| if (left < right) { | |
| return [left, right - 1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const haveSameContents = (a,b) => { | |
| for(const v of new Set([...a, ...b])) | |
| if (a.filter(e => e === v).length !== b.filter(e => e===v).length) | |
| return false; | |
| return true; | |
| }; | |
| console.log(haveSameContents([1,2,4], [2,4,1])); | |
| const isNumber = val => typeof val === 'number' && val === val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 其次,如果想要在 Python shell (Python的互動介面)中能夠只利用變數名稱就展示用來表示 Mylist 的字串,光是 __str__ 還不夠,這必須要覆寫 __repr__: | |
| class Mylist: | |
| def __init__(self): | |
| self._mylist=list() | |
| def __len__(self): |