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
alias zshconfig="code ~/.zshrc" | |
alias aliases-config="code ~/.aliases.sh" | |
alias ohmyzsh="code ~/.oh-my-zsh" | |
alias java8="sdk use java 8.0.232.hs-adpt && java -version" | |
alias java11="sdk use java 11.0.6.hs-adpt && java -version" | |
alias java12="sdk use java 12.0.1.hs-adpt && java -version" | |
alias java13="sdk use java 13.0.2.hs-adpt && java -version" | |
alias java15="sdk use java 15.0.2.hs-adpt && java -version" | |
alias nuget="mono /usr/local/bin/nuget.exe" | |
alias yarn-up="yarn upgrade-interactive --latest" |
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
class CreateUsers < ActiveRecord::Migration[6.0] | |
def change | |
create_table :users do |t| | |
t.string :first_name | |
t.string :last_name | |
t.integer :age | |
t.timestamps | |
end | |
end |
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
#!/bin/bash | |
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -d "$POSTGRES_DB" <<-EOSQL | |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
create role $ANON nologin; | |
create role $AUTHENTICATOR noinherit login password '$POSTGRES_PASSWORD'; | |
grant $ANON to $AUTHENTICATOR; | |
EOSQL |
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
version: '3.7' | |
services: | |
postgres-db: | |
image: postgres | |
restart: always | |
volumes: | |
- ./postgres/init.sh:/docker-entrypoint-initdb.d/0001-initialization.sh | |
- db-data:/var/lib/postgresql/data | |
ports: | |
- 5432:5432 |
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 './App.css'; | |
import {ApolloProvider} from '@apollo/react-hooks'; | |
import {ToastProvider} from 'react-toast-notifications'; | |
import UsersList from "./components/UsersList"; | |
import UserForm from "./components/UserForm"; | |
import client from "./HasuraApolloClient"; | |
const App: React.FC = () => { |
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, {useEffect} from 'react'; | |
import {useSubscription} from "@apollo/react-hooks"; | |
import usersSubscription from "../graphql/subscriptions/UsersSubscription"; | |
import {useToasts} from 'react-toast-notifications'; | |
const UsersObserver: React.FC = () => { | |
const {data, loading} = useSubscription(usersSubscription, {}); | |
const {addToast} = useToasts(); | |
useEffect(() => { |
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 {gql} from 'apollo-boost'; | |
const usersSubscription = gql` | |
subscription onUsersChange { | |
users { | |
created_at | |
first_name | |
id | |
last_name | |
updated_at |
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 './App.css'; | |
import {ApolloProvider} from '@apollo/react-hooks'; | |
import UsersList from "./components/UsersList"; | |
import UserForm from "./components/UserForm"; | |
import client from "./HasuraApolloClient"; | |
const App: React.FC = () => { | |
return ( |
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 {ApolloClient} from 'apollo-client'; | |
import {InMemoryCache} from 'apollo-cache-inmemory'; | |
import {HttpLink} from 'apollo-link-http'; | |
import {onError} from 'apollo-link-error'; | |
import {ApolloLink} from 'apollo-link'; | |
import {WebSocketLink} from 'apollo-link-ws'; | |
import {split} from 'apollo-link'; | |
import {getMainDefinition} from 'apollo-utilities'; | |
// @ts-ignore |
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, {RefObject} from 'react'; | |
import {useMutation} from "@apollo/react-hooks"; | |
import createNewUserMutation from "../graphql/mutations/CreateNewUserMutation"; | |
import usersQuery from "../graphql/queries/UsersQuery"; | |
const UserForm: React.FC = () => { | |
const [insertMutation, {loading, error}] = useMutation(createNewUserMutation, { | |
update: (cache, {data: {insert_users: {returning}}}) => { | |
// @ts-ignore |
NewerOlder