Skip to content

Instantly share code, notes, and snippets.

View stevewhitmore's full-sized avatar

Stephen Whitmore stevewhitmore

View GitHub Profile
@amabes
amabes / Mock-FileList-for-Unit-Test-Angular2
Last active September 15, 2023 10:55
Simplified example to demonstrate how to Mock a FileList for unit testing purposes.
// Method to test
public uploadFileList(files: FileList) {
// whatever
}
// Test
it("uploadFileList", () => {
const blob = new Blob([""], { type: "text/html" });
blob["lastModifiedDate"] = "";
blob["name"] = "filename";
@eneko
eneko / list-of-curl-options.txt
Last active May 16, 2024 18:00
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@willurd
willurd / web-servers.md
Last active May 17, 2024 16:24
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 18, 2024 11:00
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname