Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
I'm using skype, see you again.

umut yerebakmaz umutyerebakmaz

💬
I'm using skype, see you again.
View GitHub Profile
@umutyerebakmaz
umutyerebakmaz / shopping-cart.js
Last active Sep 9, 2019
Pure JavaScript Advanced shopping cart localstorage storage
View shopping-cart.js
const openCartBtn = document.querySelector(".open-cart");
const closeCartBtn = document.querySelector(".close-cart");
const clearCartBtn = document.querySelector(".clear-cart");
const cartDOM = document.querySelector(".cart");
const cartOverlay = document.querySelector(".cart-overlay");
const cartItems = document.querySelector(".cart-items");
const cartTotal = document.querySelector(".cart-total");
const checkoutTotal = document.querySelector(".checkout-total");
const itemTotal = document.querySelector(".item-total");
const cartContent = document.querySelector(".cart-content");
View client-password.d.ts
import { AccountsClient } from '@accounts/client';
import { LoginResult, CreateUser } from '@accounts/types';
import { AccountsClientPasswordOptions } from './types';
export declare class AccountsClientPassword {
private client;
private options;
constructor(client: AccountsClient, options?: AccountsClientPasswordOptions);
/**
* Create a new user.
*/
View client-password.d.ts
import { AccountsClient } from '@accounts/client';
import { LoginResult, CreateUser } from '@accounts/types';
import { AccountsClientPasswordOptions } from './types';
export declare class AccountsClientPassword {
private client;
private options;
constructor(client: AccountsClient, options?: AccountsClientPasswordOptions);
/**
* Create a new user.
*/
@umutyerebakmaz
umutyerebakmaz / laravel-websockets-ssl-lets-encrypt-certbot-supervisor-ubuntu.md
Last active Oct 10, 2019
Laravel-Websockets Deploy Nginx Virtualhost with SSL
View laravel-websockets-ssl-lets-encrypt-certbot-supervisor-ubuntu.md

Laravel-websockets, SSL Certificate, Let's Encrypt, Certbot, Supervisor, Digitalocean Ubuntu

I did two days work to run laravel-websockets on my server. It will be nice to share with you.

Steps

Step1 - Laravel Websockets Installation with composer

Laravel WebSockets can be installed via composer:

View login.service.ts
import { Injectable, OnInit } from '@angular/core';
import { AccountsClient } from '@accounts/client';
@Injectable({
providedIn: 'root'
})
export class LoginService implements OnInit {
public userLoginStatus = 'defaultLoginData';
@umutyerebakmaz
umutyerebakmaz / index.ts
Last active Oct 16, 2019
its my server file.
View index.ts
import 'reflect-metadata';
import { MongoClient } from 'mongodb';
import { AccountsServer } from '@accounts/server';
import { AccountsPassword } from '@accounts/password';
import AccountsMongoDB from '@accounts/mongo';
import { ApolloServer, attachDirectiveResolvers } from 'apollo-server';
import { AppModule } from '@modules/app/app.module';
import * as dotenv from "dotenv";
dotenv.config();
View query.resolvers.ts
import { QueryResolvers } from "@models";
import { UsersProvider } from "../providers/users.provider";
export const Query: QueryResolvers = {
allUsers: (root, args, { injector }) => injector.get(UsersProvider).getAllUsers(),
userById: (_, { id }, { injector }) => injector.get(UsersProvider).getUserById(id),
userByUsername: (_, { username }, { injector }) => injector.get(UsersProvider).getUserByUsername(username),
getUserByToken: (_, { id }, { injector }) => injector.get(UsersProvider).getUserByToken(id)
}
View UserResolver.ts
import { Resolver, Query, Ctx, Mutation, Arg, FieldResolver, Root } from "type-graphql";
import { User, RegisterInput } from '../entities/User';
import * as crypto from "crypto-js";
import { File } from "../entities/File";
import { GraphQLUpload } from 'graphql-upload';
import { createWriteStream } from "fs";
@Resolver(User)
export class UserResolver {
View UserResolver.ts
import { Resolver, Query, Ctx, Mutation, Arg, FieldResolver, Root } from 'type-graphql';
import { User, CreateUserInput } from '../entities/User';
import * as crypto from 'crypto-js';
import { File } from '../entities/File';
import { GraphQLUpload } from 'graphql-upload';
import { createWriteStream } from 'fs';
import { Like, getRepository } from 'typeorm';
@Resolver(User)
export class UserResolver {
View book.resolver.ts
import { Resolver, Query, Args, Arg, Mutation } from "type-graphql";
import { Book, BookFilter, BooksFilter, CreateBookInput } from './book.entity';
import { Like } from 'typeorm';
@Resolver(Book)
export class BookResolver {
@Query(returns => [Book])
async allBooks(
@Args() { title, skip, take }: BooksFilter