Skip to content

Instantly share code, notes, and snippets.

View chnirt's full-sized avatar
🦦
On vacation

Chnirt chnirt

🦦
On vacation
View GitHub Profile
@chnirt
chnirt / switch-version.sh
Last active May 16, 2022 03:26
Switch version
#!/bin/bash
echo "Switch version by Chnirt";
# * node v16.14.2
# * ruby 3.1.2
# * cocoapod 1.11.3
node_version_default=16.14.2
ruby_version_default=3.1.2
import React, {createContext, useEffect, useContext} from 'react';
import Realm from 'realm';
const HomeServiceSchema = {
name: 'HomeService',
properties: {
channel_url: 'string',
channel_image: 'string',
channel_type: 'string',
channel_name: 'string',
@chnirt
chnirt / machine.js
Last active April 3, 2020 09:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@chnirt
chnirt / machine.js
Last active April 3, 2020 08:17
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@chnirt
chnirt / machine.js
Last active April 3, 2020 08:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@chnirt
chnirt / app.module.ts
Last active June 19, 2019 03:49
NestJs
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
import { UserModule } from './user/user.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { join } from 'path';
@Module({
imports: [
@chnirt
chnirt / user.service.ts
Last active June 19, 2019 03:49
NestJs
import { Injectable } from '@nestjs/common';
import { UserInput } from './user.input';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from './user.entity';
import { MongoRepository } from 'typeorm';
import * as uuid from 'uuid';
@Injectable()
export class UserService {
constructor(
@chnirt
chnirt / user.resolver.ts
Last active June 18, 2019 07:51
NestJs
import { Resolver, Query, Mutation, Args } from '@nestjs/graphql';
import { UserService } from './user.service';
import { User } from './user.entity';
import { UserInput } from './user.input';
@Resolver('User')
export class UserResolver {
constructor(private readonly userService: UserService) {}
@Query(() => String)
@chnirt
chnirt / user.module.ts
Last active June 19, 2019 03:50
NestJs
import { Module } from '@nestjs/common';
import { UserResolver } from './user.resolver';
import { UserService } from './user.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from './user.entity';
@Module({
imports: [TypeOrmModule.forFeature([User])],
providers: [UserResolver, UserService],
})
@chnirt
chnirt / user.input.ts
Last active June 19, 2019 03:50
NestJs
export class UserInput {
username: string;
password: string;
}