Skip to content

Instantly share code, notes, and snippets.

View cctoni's full-sized avatar
🎯
Focusing

Toni Haupt cctoni

🎯
Focusing
  • codecentric
  • Berlin
View GitHub Profile
@cctoni
cctoni / setup.md
Created December 4, 2019 10:42 — forked from akella/setup.md
Мой сетап

То что я использую в работе и стримах

Софт для разработки

@cctoni
cctoni / SubscriptionHook.js
Created June 10, 2019 12:24 — forked from dabit3/SubscriptionHook.js
Example of using custom React hooks for managing GraphQL subscriptions
import { useEffect, useState } from 'react'
import { API, graphqlOperation } from 'aws-amplify'
const ListTalks = `
query {
listTalks {
items {
name
description
presenter {
import React from "react";
import ReactDOM from "react-dom";
import { useState, useEffect, useRef } from "react";
import posed, { PoseGroup } from "react-pose";
import "./styles.css";
let AnimatableDiv = posed.div({
enter: {
y: 0,
x: 0,
@cctoni
cctoni / database.module.ts
Created May 15, 2019 12:13 — forked from joseluisq/database.module.ts
Nest Database Module (Type ORM) with environment variables support
import { Module, Global, DynamicModule } from '@nestjs/common'
import { EnvModule } from './env.module'
import { EnvService } from './env.service'
import { TypeOrmModule } from '@nestjs/typeorm'
function DatabaseOrmModule (): DynamicModule {
const config = new EnvService().read()
return TypeOrmModule.forRoot({
type: config.DB_TYPE,
@cctoni
cctoni / ImagePost.tsx
Created April 30, 2019 07:33 — forked from aalokt89/ImagePost.tsx
Framer X Stack with design and code components
import * as React from "react";
import { Frame, Stack, PropertyControls, ControlType } from "framer";
import { Avatar, PostHeader, PostImage, PostButtonGroup } from "./canvas";
// Define type of property
interface Props {
username: string;
timeStamp: string;
postText: string;
width: number;
import * as Sentry from "@sentry/node";
import imagemin from "imagemin";
import mozjpeg from "imagemin-mozjpeg";
import sharp from "sharp";
import isJpg from "is-jpg";
import * as aws from "aws-sdk";
import { Upload } from "../../types/graphqlUtils";
import { generateFilename } from "./generateFilename";
export const s3 = new aws.S3({
import React, { Component } from "react";
import { Backpack } from "react-kawaii";
class Packy extends Component {
componentWillUnmount() {
alert(`Bye, bye 👋 \n I have to start my journey! 🗺`);
}
render() {
return <Backpack size={200} mood="excited" color="#FFD882" />;
import React, { Component } from "react";
import Packy from "./packy";
class Five extends Component {
state = {
comeHome: true
};
comeHomePacky = () => {
this.setState({ comeHome: !this.state.comeHome });
import React, { Component } from "react";
import { IceCream } from "react-kawaii";
class Four extends Component {
state = {
mood: "sad"
};
changingMood = () => {
this.setState({ mood: "sad" });
import React, { Component } from "react";
import { Browser, Ghost } from "react-kawaii";
class Three extends Component {
state = {
type: "Browser",
mood: "happy",
color: "#61DDBC",
visible: true
};