Skip to content

Instantly share code, notes, and snippets.

@RomanHotsiy
RomanHotsiy / index.page.tsx
Created August 28, 2024 15:04
Example landing page in Realm
import * as React from 'react';
import styled from 'styled-components';
import { Button } from '@redocly/theme/components/Button/Button';
import { Link } from '@redocly/theme/components/Link/Link';
import { breakpoints } from '@redocly/theme/core/utils';
export const frontmatter = {
seo: {
title: 'Demo React Page',
},

Convert markdown indented code blocks to fenced code blocks

This script runs on a folder and converts all the indented code blocks in markdown files to fenced code blocks.

The script tries to preserve the original markdown formatting.

Usage

npm install
function npm-ls-files() {
fname="$(npm pack)" && tar -ztf $fname | sed 's/^package\///g' && rm $fname
}

Keybase proof

I hereby claim:

  • I am romanhotsiy on github.
  • I am rhotsiy (https://keybase.io/rhotsiy) on keybase.
  • I have a public key ASDTy6CZapbr1L8Tr0Be9PR1B9dDcj_GUQUXAFS-UYQNJwo

To claim this, I am signing this object:

import React from 'react';
import gql from 'graphql-tag';
import { gqlLodash } from './gqlLodash';
// data here contains already transformed data
function MyComponent({data: {loading, peopleToFilms}}) {
if (loading) return (<div> Loading... </div>);
let people = Object.keys(peopleToFilms);
return (
<dl>
import { graphql } from 'react-apollo';
import { graphqlLodash } from 'graphql-lodash';
export function gqlLodash(rawQuery, config) {
const {query, transform} = graphqlLodash(rawQuery);
// save original props callback
let origProps = (config && config.props) || ((props) => props);
return (comp) => graphql(query, {...config,
props: (props) => origProps({
@RomanHotsiy
RomanHotsiy / wireshark-dcbx-howto.md
Created January 3, 2014 17:48
Wireshark DCBX HowTo

Getting the sources

You have two options to get souces:

  • use prepared tarball/archive with applied patch
  • use the latest code from version control

Using prepared tarball

Download archive file from https://db.tt/0UUO7NKb and extract sources into some folder (for example ~/wireshark). You should not apply any patches: all patches are included in archive. Goto Build steps.

Using latest code from version control