Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
// ./src/App.js
import React, { Component } from 'react'
import UsernameForm from './UsernameForm'
+import Chat from './Chat'
class App extends Component {
state = {
currentUsername: null,
- currentId: null
// ./src/Chat.js
import React, { Component } from 'react'
class Chat extends Component {
render() {
return (
<div>
<h1>Chat</h1>
</div>
// ./src/App.js
import React, { Component } from 'react'
import UsernameForm from './UsernameForm'
class App extends Component {
state = {
currentUsername: null,
currentId: null
}
// ./src/UsernameForm.js
import React, { Component } from 'react'
import { TextInput } from 'react-desktop/macOs'
import { Button } from 'react-desktop/macOs'
class UsernameForm extends Component {
constructor() {
super()
this.state = {
// ./server.js
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const Chatkit = require('pusher-chatkit-server')
const chatkit = new Chatkit.default({
instanceLocator: 'YOUR INSTANCE LOCATOR UNDER THE "CREDENTIALS" HEADER',
key:
<!-- Global site tag (gtag.js) - Google AdWords: 955504922 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-955504922"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-955504922');
</script>
import React, { Component } from 'react'
import { ChatManager, TokenProvider } from '@pusher/chatkit'
class MessageList extends Component {
render = () => (
<ul>
{this.props.messages.map(message => (
<li key={message.id}>{message.text}</li>
))}
</ul>
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const Chatkit = require('@pusher/chatkit-server')
const app = express()
const chatkit = new Chatkit.default({
instanceLocator: 'YOUR INSTANCE LOCATOR',
key:
call plug#begin('~/.local/share/nvim/plugged')
Plug 'NLKNguyen/papercolor-theme'
Plug 'pangloss/vim-javascript'
Plug 'christoomey/vim-tmux-navigator'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-vinegar'
Plug 'tpope/vim-vinegar'
render() {
return (
<div
style={{
display: 'flex',
height: '100vh',
}}
>
<div
style={{