Skip to content

Instantly share code, notes, and snippets.

View Vnthf's full-sized avatar

최민호 Vnthf

  • NHN Entertainment
  • Pankyo
View GitHub Profile
@Vnthf
Vnthf / Lattice-Example-App.tsx
Created November 16, 2021 03:42 — forked from mpossumato-netflix/Lattice-Example-App.tsx
An example approach to leveraging Lattice in a Front End React App
import { Pluggable, PluginHost, usePluggableState } from '@netflix-internal/rgt-components/lib/lattice';
import { getDefaultRoutes } from '../routes';
import { Content, Header, Router } from './components';
import { useFetchPluginConfiguration } from './hooks';
export const App = ({ appName }: { appName: string }) => {
// Fetch plugin host configuration remotely for this application
const config = useFetchPluginConfiguration(appName);
// Allow for routes to be extended by plugins
// Code block (4 spaces padded)
'use strict';
module.exports = function code(state, startLine, endLine/*, silent*/) {
var nextLine, last, token;
if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
qwefqwefqwefe
@Vnthf
Vnthf / wqefwfewef.js
Last active January 5, 2017 06:55
ewfewf
var codepen = function (markdownit) {
markdownit.renderer.rules.codepen = function tokenize_return(tokens, idx) {
return '<div class="' + tokens[idx].codepenId + ' code_pan_temp"></div>';
};
markdownit.inline.ruler.before('emphasis', 'codepen', function (state, silent) {
var CODEPAN_LINK_REGEX = /^\[[^\]]+\]\(((?:http|https):\/\/codepen.io\/(\w+)\/pen\/(\w+))\)/,
CODEPAN_INLINE_REGEX = /^((?:http|https):\/\/codepen.io\/(\w+)\/pen\/(\w+))/;
var linkParser = CODEPAN_LINK_REGEX.exec(state.src) || CODEPAN_INLINE_REGEX.exec(state.src);
if (!linkParser) {