Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
Getting after it

Ayooluwa ayoisaiah

💪
Getting after it
View GitHub Profile
@ayoisaiah
ayoisaiah / main.js
Last active Aug 3, 2020
Pomodoro Tutorial — Checkpoint 1
View main.js
const timer = {
pomodoro: 25,
shortBreak: 5,
longBreak: 15,
longBreakInterval: 4,
};
const modeButtons = document.querySelector('#js-mode-buttons');
modeButtons.addEventListener('click', handleMode);
View gosperglidergun.cells
!Name: Gosper glider gun
!Author: Bill Gosper
!The first known gun and the first known finite pattern with unbounded growth.
!www.conwaylife.com/wiki/index.php?title=Gosper_glider_gun
........................O
......................O.O
............OO......OO............OO
...........O...O....OO............OO
OO........O.....O...OO
OO........O...O.OO....O.O
View golang-integer-types.csv
Size Signed Unsigned
8-bit int8 uint8
16-bit int16 uint16
32-bit int32 uint32
64-bit int64 uint64
View app.module.ts
// src/app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { NbThemeModule, NbChatModule, NbLayoutModule } from '@nebular/theme';
import { NbEvaIconsModule } from '@nebular/eva-icons';
import { AppRoutingModule } from './app-routing.module';
View app.component.html
<nb-layout center>
<nb-layout-column>
<div *ngIf="!channel">
Loading...
</div>
<nb-chat size="large" *ngIf="channel" title="Stream Chat Angular">
<nb-chat-message
*ngFor="let msg of messages"
[message]="msg.text"
[sender]="msg.user.name"
View app.component.ts
import { Component, OnInit } from '@angular/core';
import { StreamChat, ChannelData, Message, User } from 'stream-chat';
import rug from 'random-username-generator';
import axios from 'axios';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
View index.js
require("dotenv").config();
const express = require("express");
const cors = require("cors");
const bodyParser = require("body-parser");
const { StreamChat } = require("stream-chat");
const app = express();
app.use(cors());
View App.js
import React from 'react';
import {
Chat,
Channel,
Thread,
Window,
ChannelList,
ChannelListMessenger,
ChannelPreviewMessenger,
MessageList,
View server.js
require('dotenv').config();
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const { StreamChat } = require('stream-chat');
const AWS = require('aws-sdk');
const app = express();
app.use(cors());
View .env
PORT=5500
STREAM_API_KEY=<your stream api key>
STREAM_APP_SECRET=<your stream app secret>
AWS_ACCESS_KEY_ID=<your aws access key>
AWS_SECRET_ACCESS_KEY=<your aws access secret>
You can’t perform that action at this time.