Skip to content

Instantly share code, notes, and snippets.

View mufasa71's full-sized avatar
😶‍🌫️

Shukhrat Mukimov mufasa71

😶‍🌫️
View GitHub Profile
@mufasa71
mufasa71 / Caddyfile
Created January 25, 2026 14:28 — forked from vanodevium/Caddyfile
Caddy server: enable CORS for any domain
(cors) {
@cors_preflight method OPTIONS
header {
Access-Control-Allow-Origin "{header.origin}"
Vary Origin
Access-Control-Expose-Headers "Authorization"
Access-Control-Allow-Credentials "true"
}
{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 5.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -100.0,
"hpf-frequency": 10.0,
@mufasa71
mufasa71 / README.md
Created September 14, 2023 08:56 — forked from kfox/README.md
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
@mufasa71
mufasa71 / choosy
Created September 16, 2022 09:44 — forked from cesarolea/choosy
Open browser based off of certain rules (like choosy for macOS)
#!/bin/bash
URL=$1
DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}')
## Domain starts with
if [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-start.txt)\)$) ]]; then
chromium-browser "$URL" & disown
elif [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-is.txt)\)$) ]]; then
firefox "$URL" & disown
@mufasa71
mufasa71 / generateFlowModuleNameMappers.js
Created June 20, 2018 06:28 — forked from turadg/generateFlowModuleNameMappers.js
Helper to create .flowconfig module name mapper
#!/usr/bin/env node
/**
* Flowtype understands Node (or Haste) imports but not Webpack.
*
* Many codebases have webpack set up like:
* src/foo.js
* src/components/Bar.jsx
*
* And then import them like `require('foo')` or `require/components/Bar.jsx`
*
@mufasa71
mufasa71 / _readme.md
Created June 20, 2018 06:28 — forked from lambdahands/_readme.md
FlowType and CSS Modules

Huh?

So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).

What WebPack allows us to do is "require" CSS files and use their class names:

import styles from "my_styles.css";
import React from "react";
@mufasa71
mufasa71 / flow-ignore.js
Created June 20, 2018 06:27 — forked from zerobias/flow-ignore.js
Make flow ignore all unrelated deps and work much faster
//@flow
const {
readdirSync,
outputFileSync,
pathExistsSync,
//$todo
readFileSync,
} = require('fs-extra')
@mufasa71
mufasa71 / archlinux_lxc_cannot_start.md
Last active August 14, 2017 08:39
archlinux in unprivileged lxc systemd cannot start

lxc/lxc#1678

lxc.init_cmd = /sbin/init systemd.legacy_systemd_cgroup_controller=yes

config:
  raw.lxc: lxc.init_cmd = /sbin/init systemd.legacy_systemd_cgroup_controller=yes
@mufasa71
mufasa71 / npm_shared_folders.md
Created July 1, 2017 13:34
npm shared folders
# if running inside VirtualBox on a shared folder
# you must enable symlinks on the shared folder
$ VBoxManage setextradata "<vm name>" VBoxInternal2/SharedFoldersEnableSymlinksCreate/<shared folder> 1

# verify with
$ VBoxManage getextradata "<vm name>" enumerate

npm install --no-bin-links

/usr/share/lxc/config/common.conf.d/01-extra-mounts.conf

lxc.hook.pre-start = /usr/local/bin/lxc-extra-mounts
lxc.hook.post-stop = /usr/local/bin/lxc-extra-mounts

/usr/local/bin/lxc-extra-mounts

#!/bin/bash

ACTION="${3}"