Skip to content

Instantly share code, notes, and snippets.

@sep2
sep2 / iprule.sh
Created July 23, 2021 06:47 — forked from codehz/iprule.sh
nftables for redir proxy
ip rule add fwmark 0x233 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100
@sep2
sep2 / hello-world.cc
Created March 24, 2021 09:41 — forked from tejom/hello-world.cc
console.log v8
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream>
#include <iostream>
@sep2
sep2 / postbuild.js
Last active March 7, 2020 14:14
Parcel v1 change build output dir instead of a flatten structure
const fs = require('fs')
const path = require('path')
const replace = require('replace-in-file')
const escapeRegExp = require('lodash.escaperegexp')
// the directory in which you're outputting your build (come from parcel)
const basePath = path.resolve(__dirname, 'dist')
console.log('basePath', basePath)
@sep2
sep2 / parcel-v1-dev-wtach.ts
Last active March 7, 2020 14:17
Parcel v1 watch mode with typescript checking types after bundle end to speed up compiling and proxy api request
import * as ts from 'typescript'
import * as Bundler from 'parcel-bundler'
import * as express from 'express'
import { createProxyMiddleware, Options as ProxyOptions } from 'http-proxy-middleware'
import { merge, Observable, partition, Subscriber } from 'rxjs'
import { buffer, bufferCount, filter, map, share, skipWhile, tap, timestamp } from 'rxjs/operators'
//============================================================
process.env.NODE_ENV = 'development'