View rustdeps.sh
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 |
View try.js
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) { |
View formikexample.js
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> |
View WebpackLastFilesLoggerPlugin.js
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(); |
View locateLoader.js
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( |
View gist:c6bc4ef536681d712913069f7ffe967e
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/ |
View gist:955122708468bb4ae3c9aaf83c4c3dca
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; |
View gist:39d58379bb16ea46c6d1374202d28615
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 |
View razzle-plugin-node-runtime-vars.js
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} |
View web.config
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