This file contains hidden or 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
| // Async tool with external API call | |
| server.registerTool( | |
| "fetch-weather", | |
| { | |
| title: "Weather Fetcher", | |
| description: "Get weather data for a city", | |
| }, | |
| async () => { | |
| const result = await server.server.elicitInput({ | |
| message: `No tables available. Would you like to check alternative dates?`, |
This file contains hidden or 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 { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | |
| import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; | |
| const server = new McpServer( | |
| { | |
| name: "My MCP", | |
| version: "1.0.0", | |
| }, | |
| { | |
| capabilities: { |
This file contains hidden or 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 { useDispatch } from 'react-redux' | |
| import someAction from 'actions/someAction' | |
| export const useSomeAction = () => { | |
| let {setToast} = useJessesContext() | |
| const dispatch = useDispatch() | |
| return ({message, someOtherActionDataIneed}) => { | |
| dispatch( | |
| someAction({setToast, message, someOtherActionDataIneed}) |
This file contains hidden or 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
| if (typeof window === 'undefined') { | |
| global.window = new Proxy( | |
| {}, | |
| { | |
| get: (_, key) => { | |
| // may need to add new stuff here to account for other method types | |
| return () => global.window; | |
| }, | |
| set: target => console.log(target), | |
| } |
This file contains hidden or 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
| return ( | |
| <div> | |
| <Header /> | |
| <Products /> | |
| <AddToCart /> | |
| <Footer /> | |
| </div> | |
| ) |
This file contains hidden or 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
| (function(d) { | |
| var script = d.createElement("script"); | |
| script.type = "text/javascript"; | |
| script.text = | |
| 'import("https://passwordless.app/account/module/integrated.js");window.supportsDynamicImport = true;'; | |
| d.getElementsByTagName("head")[0].appendChild(script); | |
| var script2 = d.createElement("script"); | |
| script2.type = "text/javascript"; |
This file contains hidden or 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
| //map and use Form over and over, add a button to add another field to state. All up to you | |
| //Form doesn't render a form element, this way it works in rn and web, and wherever else. | |
| // you can wrap all of them in one if you want. | |
| const App = () => { | |
| let [values, setValues] = React.useState([{name: 'test'}]) | |
| return values.map((value, index) => ( | |
| <Form | |
| values={values} |
This file contains hidden or 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
| # set the version from an env variable in ios | |
| /usr/libexec/Plistbuddy -c "Set CFBundleShortVersionString $BUILD_NUMBER" "ios/cnnrnv2/Info.plist" | |
| #in android, app/build.gradle | |
| # versionName = System.env.BUILD_NUMBER |
This file contains hidden or 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
| setInterval(function() { | |
| Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')) | |
| .forEach(function(element) { | |
| element.style.background = 'rgba(255,0,0,0.1)'; | |
| }) | |
| }, 500) |
This file contains hidden or 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
| version: '3.3' | |
| services: | |
| db: | |
| image: mysql:latest | |
| volumes: | |
| - dbdata:/var/lib/mysql | |
| restart: always | |
| ports: | |
| - "3306:3306" |
NewerOlder