Skip to content

Instantly share code, notes, and snippets.

View Raidus's full-sized avatar

Wilhelm R. Raidus

View GitHub Profile
@Raidus
Raidus / gist:5bccebc803d0eda974bb1468431c6600
Created June 30, 2020 11:24 — forked from getify/gist:3667624
escape all double-quote chars in a string
// NOTE: only escapes a " if it's not already escaped
function escapeDoubleQuotes(str) {
return str.replace(/\\([\s\S])|(")/g,"\\$1$2"); // thanks @slevithan!
}
escapeDoubleQuotes("ab"); // ab => ab
escapeDoubleQuotes("a\"b"); // a"b => a\"b
escapeDoubleQuotes("a\\\"b"); // a\"b => a\"b
escapeDoubleQuotes("a\\\\\"b"); // a\\"b => a\\\"b
escapeDoubleQuotes("a\\\\\\\"b"); // a\\\"b => a\\\"b
@Raidus
Raidus / Spark+ipython_on_MacOS.md
Created November 10, 2020 15:46 — forked from ololobus/Spark+ipython_on_MacOS.md
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times