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
{ | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.snippetSuggestions": "bottom", | |
"window.zoomLevel": 0, | |
"workbench.colorCustomizations": { | |
"statusBar.background": "#000", | |
"statusBar.border": "#222", | |
"statusBar.foreground": "#02bb7d", | |
"sideBar.background": "#081014", |
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 { ADD_TODO, REMOVE_TODO } from '../actions/todos'; | |
const changes = {}; | |
let currentVersion = -1; | |
const noOfVersionsSupported = 100; | |
const undoableActions = [ADD_TODO, REMOVE_TODO]; | |
export default function(state = initialState, action) { | |
return produce(state, draft => { | |
// ... code removed for brevity |
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 { withAuthenticator } from 'aws-amplify-react'; | |
function App() { | |
return ( | |
... | |
) | |
} | |
export default withAuthenticator(App, { | |
includeGreetings: 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
{ | |
"semi": true, | |
"singleQuote": true, | |
"trailingComma": "none", | |
"tabWidth": 2, | |
"useTabs": false, | |
"bracketSpacing": 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
import React, { useContext } from 'react'; | |
import { Button } from '@material-ui/core'; | |
import { ThemeContext} from './ThemeProvider'; | |
const App: React.FC = () => { | |
// Get the setter function from context | |
const setThemeName = useContext(ThemeContext) | |
return ( | |
<div className="App"> |
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
package controllers | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/techinscribed/repository-db/models" | |
) | |
// BaseHandler will hold everything that controller needs |
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 Amplify, { Auth } from 'aws-amplify'; | |
Amplify.configure({ | |
Auth: { | |
region: 'us-east-1', | |
userPoolId: '**********', | |
userPoolWebClientId: '******************', | |
} | |
}); |
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
// Connect will receive the $connect request | |
// It will handle the authorization also | |
func Connect(request APIGatewayWebsocketProxyRequest) (interface{}, error) { | |
if request.RequestContext.Authorizer == nil { | |
return Authorizer(request) | |
} | |
id := request.RequestContext.Authorizer.(map[string]interface{})["cognito:username"].(string) | |
connectionID := request.RequestContext.ConnectionID | |
StoreSocket(id, connectionID) |