Skip to content

Instantly share code, notes, and snippets.

@matijagrcic
matijagrcic / settings.json
Created November 19, 2020 08:58 — forked from jayphelps/settings.json
Modifications on top of "Community Material Theme Palenight" Before and after: https://twitter.com/_jayphelps/status/1259321038728560642?s=20
// Modify your settings.json to add these. Customize further how you prefer.
{
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.tabCloseButton": "off",
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#ffffff06",
"editor.foreground": "#acb3db",
"selection.background": "#89DDFF",
"progressBar.background": "#89DDFF",
"textLink.foreground": "#89DDFF",
import React, { useState, useEffect, useContext } from "react";
import { Checkout } from "shopify-storefront-api-typings";
import Client from "shopify-buy";
const SHOPIFY_CHECKOUT_STORAGE_KEY = "shopify_checkout_id";
const storefrontAccessToken = process.env.GASTBY_SHOPIFY_ACCESS_TOKEN as string;
const client = Client.buildClient({
storefrontAccessToken,
const sanityClient = require('@sanity/client');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
} = process.env;
const client = sanityClient({
projectId: SANITY_PROJECT_ID,
@matijagrcic
matijagrcic / PiHole.md
Created August 7, 2019 09:23
Raspberry Pi with PiHole
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this:
@matijagrcic
matijagrcic / HeaderLogo.tsx
Created May 22, 2019 07:46 — forked from ryanditjia/HeaderLogo.tsx
Gatsby + TypeScript
// Example useStaticQuery
// this is src/components/HeaderLogo.tsx
import { graphql, Link, useStaticQuery } from 'gatsby'
import React from 'react'
import { HeaderLogoQuery } from '../types/__generated__/HeaderLogoQuery'
const query = graphql`
query HeaderLogoQuery {
contentfulCompanyMetadata {
@matijagrcic
matijagrcic / NVMe_AHCI
Last active May 1, 2019 20:25
I've needed to change to ACHI so that the NVMe driver can be installed, it wouldn't otherwise and the Samsung Magician wouldn't recognize the drive. https://twitter.com/matijagrcic/status/1067498617366294528
If you don’t see Command Prompt listed, it’s because you have already been updated to a later version of Windows.
If so, use this method instead to get to the Command Prompt:
Click the Start Button and type cmd
Right-click the result and select Run as administrator
Type this command and press ENTER: bcdedit /set {current} safeboot minimal
If this command does not work for you, try bcdedit /set safeboot minimal
Restart the computer and enter BIOS Setup (the key to press varies between systems).
Change the SATA Operation mode to AHCI from either IDE or RAID (again, the language varies).
Save changes and exit Setup and Windows will automatically boot to Safe Mode.
Right-click the Windows Start Menu once more. Choose Command Prompt (Admin).
@matijagrcic
matijagrcic / NVMe_AHCI
Created May 1, 2019 20:25
I've needed to change to ACHI so that the NVMe driver can be installed, it wouldn't otherwise and the Samsung Magician wouldn't recognize the drive.
If you don’t see Command Prompt listed, it’s because you have already been updated to a later version of Windows.
If so, use this method instead to get to the Command Prompt:
Click the Start Button and type cmd
Right-click the result and select Run as administrator
Type this command and press ENTER: bcdedit /set {current} safeboot minimal
If this command does not work for you, try bcdedit /set safeboot minimal
Restart the computer and enter BIOS Setup (the key to press varies between systems).
Change the SATA Operation mode to AHCI from either IDE or RAID (again, the language varies).
Save changes and exit Setup and Windows will automatically boot to Safe Mode.
Right-click the Windows Start Menu once more. Choose Command Prompt (Admin).
Microsoft Windows [Version 10.0.17134.345]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd %systemroot%\system32
C:\Windows\system32>copy mstsc.exe mstsc2.exe
1 file(s) copied.
C:\Windows\system32>cd %systemroot%\system32\en-us\