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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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 React from "react"; | |
import { render } from "react-dom"; | |
const ParentComponent = React.createClass({ | |
getDefaultProps: function() { | |
console.log("ParentComponent - getDefaultProps"); | |
}, | |
getInitialState: function() { | |
console.log("ParentComponent - getInitialState"); | |
return { text: "" }; |
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
var _ = require('lodash'); | |
var statusObj = { | |
"01": ["a","b"], | |
"03": ["c","d"], | |
"04": ["e","c"] | |
}; | |
var myItem = _.findKey(statusObj, (item) => (item.indexOf("a") !== -1)); |
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
class Button extends React.Component{ | |
handleClick = () => { | |
this.props.onClickFunc(this.props.increment); | |
} | |
render(){ | |
return( | |
<button onClick={this.handleClick}>+{this.props.increment}</button> | |
) | |
} | |
} |
Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo
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
{ | |
"rules": { | |
"typescript": { | |
"noImplicitAny": true, | |
"strictNullChecks": true, | |
"noUnusedLocals": true, | |
"noUnusedParameters": true | |
}, | |
"formatting": { | |
"singleQuote": true, |
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
Show hidden characters
{ | |
"name": "Replit Stable Environment", | |
"image": "mcr.microsoft.com/devcontainers/typescript-node:18", | |
"features": { | |
"ghcr.io/devcontainers/features/node:1": { | |
"version": "18" | |
}, | |
"ghcr.io/devcontainers/features/git:1": {} | |
}, | |
"customizations": { |
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
openapi: 3.0.0 | |
info: | |
title: Sample REST API for MCP | |
version: 1.0.0 | |
description: Example API that can be wrapped as an MCP server | |
servers: | |
- url: https://api.example.com/v1 | |
paths: |