Skip to content

Instantly share code, notes, and snippets.

View nataliemarleny's full-sized avatar
🧠
Thinking about thinking

Natalie Marleny nataliemarleny

🧠
Thinking about thinking
View GitHub Profile
@nataliemarleny
nataliemarleny / md-to-html.sh
Last active July 20, 2019 18:16
Convert markdown files from a directory, into a directory of html files
#!/usr/bin/env bash
set -eu -o pipefail
markdown_dir="${1:-markdown}"
html_dir="${2:-html}"
MARKED_EXEC="${MARKED_EXEC:-yarn exec marked}"
sanitise() {
cat | sed 's#\.md#.html#g'
}
@nataliemarleny
nataliemarleny / tasksError.md
Last active July 20, 2019 12:19
tasks.json
@nataliemarleny
nataliemarleny / nextjs-link-documentation.md
Last active July 17, 2019 20:40
Notes on Issue #7941 for Next.js
@nataliemarleny
nataliemarleny / hipster_graphql.js
Created July 7, 2019 12:09
ES6 object syntax (implicit object properties)
// Reduced
const obj1 = {
fun1() {}
}
const obj1 = {
fun1: () => {}
}
// this
@nataliemarleny
nataliemarleny / sum.test.js
Created May 13, 2019 07:35
Initial unit test - jest setup
const sum = require('./sum');
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
@nataliemarleny
nataliemarleny / sum.js
Created May 13, 2019 07:34
Jest setup - initial file
function sum(a, b) {
return a + b;
}
module.exports = sum;
@nataliemarleny
nataliemarleny / package.json
Created May 12, 2019 18:00
Add this to scripts in package.json when initialising Jest in a project
{
"scripts": {
"test": "jest"
}
}
@nataliemarleny
nataliemarleny / package.json
Created May 12, 2019 16:45
Next.js sandbox - add the following entries to scripts:
{
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
}
}
@nataliemarleny
nataliemarleny / index.js
Created May 12, 2019 16:42
Create a starting page in pages/index.js in a Next.js sandbox
const Main = () => (
<div>Main page!</div>
);
export default Main;
@nataliemarleny
nataliemarleny / minimal-javascript-gitignore
Last active July 15, 2021 11:06
Minimal .gitignore file for a Javascript sandbox
# JavaScript
node_modules
.next
# Mac
.DS_Store