Skip to content

Instantly share code, notes, and snippets.

View YannickFricke's full-sized avatar
:octocat:
A ❤️ for open source

Yannick Fricke YannickFricke

:octocat:
A ❤️ for open source
View GitHub Profile
import { Identifiable } from '@applier/framework/dist/definitions/Identifiable';
import { v4 } from 'uuid';
import { IRepository } from '@applier/framework/dist/definitions/IRepository';
export const useRepository = <T extends Identifiable>(entities: T[], setEntities: (newValues: T[]) => void): IRepository<T> => {
return {
getAll: function() {
return entities;
},
insert: function(entity: T) {
@YannickFricke
YannickFricke / Knex.js
Last active August 15, 2020 19:09
Select mutliple IDs with TypeORM and Knex.JS from a SQLite database
let queryBuilder = knex<Message>('')
.from('message');
if (!user.isGameMaster) {
queryBuilder = queryBuilder
.whereIn(
'recipient',
all.concat('Alle'),
)
.or
@YannickFricke
YannickFricke / debug-grid.css
Created June 13, 2020 01:23 — forked from kesor/debug-grid.css
debug css grid
/* DEBUG Grid */
body {
position: relative;
background: blue;
}
body:after {
background-size: var(--grid-size) var(--grid-size);
background-repeat: repeat;
background-image:
linear-gradient(
import { createLogger, format, Logger, transports } from 'winston';
const { Console } = transports;
export const getLogger = (): Logger => {
const consoleTransport = new Console({
format: format.combine(
format.colorize(),
format.timestamp({
format: 'DD.MM.YYYY HH:mm:ss',
@YannickFricke
YannickFricke / Command.ts
Last active October 10, 2023 00:49
TypeScript Command Manager
/**
* Defines a basic command
*
* @export
* @interface Command
*/
export interface Command {
/**
* The name of the command
*
@YannickFricke
YannickFricke / Dockerfile
Last active March 9, 2020 11:35
NGINX + PHP-FPM + Composer + Symfony + Redis
FROM php:7.4.2-fpm as symfonyStage
RUN apt-get update
RUN apt-get install -y wget
RUN wget https://get.symfony.com/cli/installer -O - | bash
RUN mv $HOME/.symfony/bin/symfony /usr/local/bin/symfony
FROM php:7.4.2-fpm as composerStage
@YannickFricke
YannickFricke / Navbar.html
Last active February 24, 2020 14:42
Tailwind CSS responsive navbar
<div class="md:flex w-full text-center sm:mt-4 md:mt-0 md:p-4">
<div class="cursor-default text-lg font-bold">
My Brand name
</div>
<a href="/">Home</a>
<a href="/account">My account</a>
<a href="/settings">Settings</a>
<a href="/imprint">Imprint</a>
</div>
@YannickFricke
YannickFricke / docker-compose.yml
Created December 16, 2019 13:48
Shopware 6 docker-compose
version: "2"
services:
shopware:
image: shopware:6.1.0-rc2
build:
dockerfile: ./Dockerfile
context: .
volumes:
- ./:/sw6
ports:
@YannickFricke
YannickFricke / auto_push.sh
Created August 12, 2019 13:49
GIT Auto pusher
#!/bin/bash
FIRST_ARG=$1
set -a REMOTES
getLatestCommit() {
git rev-parse HEAD
}
[
{
"metadata": {
"id": "b1b0f283-8246-4e90-832e-a6c409d378d1",
"publisherId": "mads-hartmann.bash-ide-vscode",
"publisherDisplayName": "mads-hartmann"
},
"name": "bash-ide-vscode",
"publisher": "mads-hartmann",
"version": "1.3.3"