This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << EOF | python3 | |
import re | |
import requests | |
import json | |
# Regular expression to match Rust use statements | |
regex = r"use ([^;]+);" | |
# Rust source code as a multiline string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import logo from './react.svg'; | |
import './Home.css'; | |
import { Helmet} from 'react-helmet-async'; | |
import axios from 'axios'; | |
class Home extends React.Component { | |
my_title = 'sss' | |
constructor(props) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Formik } from "formik"; | |
const BasicExample = () => { | |
const buttonRef = useRef(); | |
return ( | |
<div> | |
<h1>My Form</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// https://github.com/storybookjs/storybook/issues/14342 | |
// https://webpack.js.org/contribute/plugin-patterns/#monitoring-the-watch-graph | |
/** | |
* Logs the last changed files during webpack rebuilds. | |
*/ | |
class WebpackLastFilesLoggerPlugin { | |
constructor() { | |
this.startTime = Date.now(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (rules, loaderName) => { | |
// i.e.: /eslint-loader/ | |
const loaderRegex = new RegExp(`[/\\\\]${loaderName}[/\\\\]`); | |
return rules.reduce((info, rule, ruleIndex) => { | |
if (rule.use) { | |
// Checks if there is an object inside rule.use with loader matching loaderRegex, OR | |
// Checks another condition, if rule is not an object, but pure string (ex: "style-loader", etc) | |
const useIndex = (typeof rule.use === 'function' ? rule.use({}) : rule.use).findIndex( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// razzle.config.js | |
'use strict'; | |
module.exports = { | |
modifyWebpackOptions({ | |
options: { | |
webpackOptions, // the modified options that was used to configure webpack/ webpack loaders and plugins | |
} | |
}) { | |
webpackOptions.babelRule.include = webpackOptions.babelRule.include.concat([ | |
/grommet/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><meta charset="utf-8"/><title>Examples Test Report</title><style type="text/css">html, | |
body { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 1rem; | |
margin: 0; | |
padding: 0; | |
color: #333; | |
} | |
body { | |
padding: 2rem 1rem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tests for isomorphic examples | |
tests for the basic example | |
✓ should install packages (17243 ms) | |
✓ should build successfully (4276 ms) | |
✓ should start devserver and exit (3275 ms) | |
tests for the basic-spa example | |
✓ should install packages (17225 ms) | |
✓ should build successfully (3311 ms) | |
✓ should start devserver and exit (2690 ms) | |
tests for the with-custom-babel-config example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The passed list of environment variables will be removed from the nodejs | |
* instance of webpack.DefinePlugin, so they can be resolved dynamically at | |
* runtime. | |
* @example | |
* // Include this in the plugins array exported by razzle.config.js | |
* const nodeRuntimeVarsPlugin = createRazzlePluginNodeRuntimeVars('PORT', 'HOST'); | |
* @param {String} ...nodeRuntimeVars | |
* @return {Function} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
This configuration file is required if iisnode is used to run node processes behind | |
IIS or IIS Express. For more information, visit: | |
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config | |
--> | |
<configuration> | |
<system.webServer> |
NewerOlder