Skip to content

Instantly share code, notes, and snippets.

View NickyMeuleman's full-sized avatar
🏎️
When not coding, I'm simracing

Nicky Meuleman NickyMeuleman

🏎️
When not coding, I'm simracing
View GitHub Profile
@NickyMeuleman
NickyMeuleman / layout.js
Created July 6, 2018 15:07
query for image in layout component
import React from 'react'
import { Link } from 'gatsby'
import { rhythm, scale } from '../utils/typography'
import { StaticQuery, graphql } from 'gatsby'
class Template extends React.Component {
render() {
const { location, children } = this.props
@NickyMeuleman
NickyMeuleman / settings.json
Created July 9, 2018 18:09
VSCode settings.json
{
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"editor.fontSize": 18,
"terminal.integrated.fontSize": 18,
"editor.renderWhitespace": "all",
"window.menuBarVisibility": "toggle",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"terminal.integrated.fontFamily": "consolas",
"files.eol": "\n",
@NickyMeuleman
NickyMeuleman / drivers.json
Created December 19, 2018 20:45
JSON-schema
{
"$schema": "./drivers.schema.json",
"series": "f1",
"season": 2018,
"driverList": [
{
"raceNumber": 14,
"code": "ALO",
"firstName": "Fernando",
"lastName": "Alonso",
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",

Markdown file

Created in VSCode, using the GistPad extension

Let's upload a screenshot from the clipboard, because I can

Apparently I can't. I'm on WSL2, maybe that's why, it's in my Windows clipboard

  • Making a list.
  • Checking it twice.
title
404 - Not Found

import TextLayout from '../components/text-layout.js'; import { Link } from "gatsby"; export default TextLayout;

Potato salad Page not found

let urlObj = new URL(`https://publish.twitter.com/oembed`);
urlObj.search = new URLSearchParams({
url: "https://twitter.com/NMeuleman/status/1211692091954339841",
theme: "dark",
dnt: true,
omit_script: true
});
const urlString = urlObj.toString();
// https://publish.twitter.com/oembed?url=https%3A%2F%2Ftwitter.com%2FNMeuleman%2Fstatus%2F1211692091954339841&theme=dark&dnt=true&omit_script=true
// Totally fine option that takes 2 lines
import { infiniteBooper } from "./some/other/file.js";
export { infiniteBooper };
// Same thing, done on a single line
export { infiniteBooper } from "./some/other/file.js";
/** @jsx jsx */
// import React from 'react';
import { jsx } from 'theme-ui';
import { Link, graphql } from 'gatsby';
import { PostCard } from '@nickymeuleman/gatsby-theme-blog';
import testImg from './test.jpg';
const IndexPage = ({ data }) => {
console.log(data);
@NickyMeuleman
NickyMeuleman / default-values.js
Last active February 28, 2020 15:07
logical OR vs nullish coalescing
const value = 0
const defaultWithLogicalOR = value || 1
// result: 1
const defaultWithNullishCoalescing = value ?? 1;
// result: 0