Shortcut | Description |
---|---|
Ctrl+Shift+P | command prompt |
Ctrl+Alt+P | switch project |
Ctrl+P | go to file |
Ctrl+G | go to line |
This file contains 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
// based on gist https://gist.github.com/kristopherjohnson/4201fbe86473f6edb207 | |
// and discussion | |
// https://forums.swift.org/t/recommended-way-to-measure-time-in-swift/33326/4 | |
// https://github.com/apple/swift-corelibs-xctest/pull/109 | |
// Ensures Monotonic time | |
public func executionTimeInterval(block: () -> ()) -> TimeInterval { | |
let start = Foundation.ProcessInfo.processInfo.systemUptime | |
block(); | |
let end = Foundation.ProcessInfo.processInfo.systemUptime |
This file contains 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
// based on https://gist.github.com/szhernovoy/276e69eb90a0de84dd90 | |
// and my performance measurements | |
public func randomString(of length: Int) -> String { | |
let letters = Array("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") | |
var s = "" | |
for _ in 0 ..< length { | |
s.append(letters.randomElement()!) | |
} | |
return s | |
} |
This file contains 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
#!/usr/bin/env python | |
__author__ = "github.com/ruxi" | |
__license__ = "MIT" | |
import requests | |
import tqdm # progress bar | |
import os.path | |
def download_file(url, filename=False, verbose = False): | |
""" | |
Download file with progressbar | |
This file contains 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
import time | |
from concurrent.futures import ThreadPoolExecutor | |
from functools import wraps | |
import requests | |
from tqdm import tqdm | |
def timeit(method): | |
@wraps(method) |