Skip to content

Instantly share code, notes, and snippets.

@mirzap
mirzap / ufw-glusterfs.conf
Created July 7, 2021 11:30 — forked from Diftraku/ufw-glusterfs.conf
UFW Application Profile for GlusterFS
[GlusterFS Daemon]
title=GlusterFS (Daemon)
description=GlusterFS Daemon
ports=24007/tcp
[GlusterFS Management]
title=GlusterFS (Management)
description=GlusterFS Management
ports=24008/tcp
@mirzap
mirzap / docker-compose.yaml
Created July 4, 2021 10:30 — forked from darth-veitcher/docker-compose.yaml
Traefik v2.0 with Cloudflare Wildcard and OpenVPN
version: "3"
services:
traefik:
image: "traefik:v2.0"
container_name: "traefik"
command:
# Globals
- "--log.level=DEBUG"
- "--api=true"
import React, { useEffect, useState } from 'react'
import PropTypes from 'prop-types'
import styled, { withTheme } from 'styled-components'
import { withSearch } from '@elastic/react-search-ui'
import _get from 'lodash/get'
import Slider from 'rc-slider'
import 'rc-slider/assets/index.css'
import { FacetContainer, FacetHeader } from './SearchFacet'
@mirzap
mirzap / Hasura Keycloak.md
Created January 6, 2021 10:39 — forked from webdeb/Hasura Keycloak.md
Basic Keycloak Script Mapper to provide Hasura claims

Steps to provide Hasura Claims in Keycloak generated JWT

  1. Create your realm / client
  2. Inside client configuration go to "Mappers"
  3. Click on "Create"
  4. Name it "hasura"
  5. Choose Mapper Type "Script Mapper"
  6. Add following script to demonstrate how it works
@mirzap
mirzap / machine.js
Created December 9, 2020 14:18
Generated by XState Viz: https://xstate.js.org/viz
const timerMachine = Machine({
id: "timer",
initial: "pending",
states: {
pending: {
onEntry: ["setDefaults"],
on: {
START: "running"
}
},
@mirzap
mirzap / node-user-agent.js
Created September 27, 2020 16:31 — forked from ninjascribble/node-user-agent.js
Fetching the user-agent string from a request using either NodeJS or NodeJS + Express
/** Native NodeJS */
var http = require('http')
, server = http.createServer(function(req) {
console.log(req.headers['user-agent']);
});
server.listen(3000, 'localhost');
/** NodeJS with Express */
var express = require('express')
@mirzap
mirzap / nginx.conf
Created May 25, 2020 15:20 — forked from CSRaghunandan/nginx.conf
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@mirzap
mirzap / delete_git_submodule.md
Created April 16, 2020 15:31 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@mirzap
mirzap / AuthorSubscriptions.svelte
Created April 10, 2020 16:43 — forked from praveenweb/AuthorSubscriptions.svelte
GraphQL Subscriptions using Svelte
<script context="module">
import gql from 'graphql-tag';
import { client } from './apollo';
import { subscribe } from 'svelte-apollo';
const AUTHOR_LIST = gql`
subscription {
author(order_by: [{name: asc}]) {
name