Skip to content

Instantly share code, notes, and snippets.

View zackify's full-sized avatar

Zach Silveira zackify

View GitHub Profile
// 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?`,
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: {
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})
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),
}
return (
<div>
<Header />
<Products />
<AddToCart />
<Footer />
</div>
)
@zackify
zackify / Test.js
Created May 10, 2020 01:30
Example loading module vs no module
(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";
//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}
# 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

Keybase proof

I hereby claim:

  • I am zackify on github.
  • I am zackify (https://keybase.io/zackify) on keybase.
  • I have a public key whose fingerprint is 03B5 3C3F A415 039C 2749 BD5F F1B3 BDD4 B320 A804

To claim this, I am signing this object:

export const api = ({ url, headers = {}, body, method }) =>
new Promise(async (resolve, reject) => {
try {
body = JSON.stringify(body);
headers['Content-Type'] = 'application/json';
} catch (e) {}
//intercept before if i want
let token = await storage.get('userToken')
headers.Authorization = token