Skip to content

Instantly share code, notes, and snippets.

View navono's full-sized avatar
:octocat:
I may be slow to respond.

Darkness navono

:octocat:
I may be slow to respond.
View GitHub Profile
@navono
navono / nginx.conf
Created March 9, 2022 00:37
download electron package behind nginx reverse proxy
#user nobody;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@navono
navono / settings.xml
Created February 24, 2022 08:01
maven aliyun
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers/>
@navono
navono / launch.json
Created February 23, 2022 06:10 — forked from cecilemuller/launch.json
Run ts-node in VSCode Debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Example",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
@navono
navono / mouse.py
Last active October 14, 2021 06:07
检测鼠标点击
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from pynput import mouse
from psutil import *
import time
from datetime import datetime
class mouseTimer(object):
@navono
navono / .bashrc
Created September 30, 2021 01:59
.bashrc for WSL2
# CUSTOM MIRRORS
export HOST_IP=$(grep -oP '(?<=nameserver\ ).*' /etc/resolv.conf)
export PORXY_ADDR="http://$HOST_IP:1080"
# PROXY FOR APT
function proxy_apt() {
# make sure apt.conf existed
sudo touch /etc/apt/apt.conf
sudo sed -i '/^Acquire::https\?::Proxy/d' /etc/apt/apt.conf
@navono
navono / CMakeLists.txt
Created July 7, 2021 07:42
CMake include Windows SDK path
include(FindWindowsSDK)
if (NOT WINDOWSSDK_FOUND)
message("Windows SDK not found")
endif()
get_windowssdk_include_dirs(${WINDOWSSDK_LATEST_DIR} WINDOWSSDK_INCLUDE_DIRS)
# message(${WINDOWSSDK_INCLUDE_DIRS})
target_include_directories(${TARGET} INTERFACE ${WINDOWSSDK_INCLUDE_DIRS})
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE /SAFESEH:NO")
@navono
navono / proto.js
Created July 6, 2021 09:06
compile proto file with js
const path = require('path');
const fs = require('fs');
const shell = require('shelljs');
const rimraf = require('rimraf');
// https://github.com/shelljs/shelljs/issues/469
process.env.PATH += (path.delimiter + path.join(process.cwd(), 'node_modules', '.bin'));
const PROTO_DIR = path.join(__dirname, '../proto');
const OUT_DIR = path.join(__dirname, '../src/proto');
@navono
navono / schema_adapter_sqlite3.go
Created February 5, 2021 11:21
watermill sqlite3
package main
import (
stdSQL "database/sql"
"encoding/json"
"fmt"
"strings"
"github.com/pkg/errors"
@navono
navono / offsets_adapter_sqlite3.go
Last active February 5, 2021 11:20
watermill sqlite3
package main
import "fmt"
type DefaultSQLite3OffsetsAdapter struct {
// GenerateMessagesOffsetsTableName may be used to override how the messages/offsets table name is generated.
GenerateMessagesOffsetsTableName func(topic string) string
}
func (a DefaultSQLite3OffsetsAdapter) SchemaInitializingQueries(topic string) []string {
@navono
navono / arm64-on-Win10.md
Created December 14, 2020 04:58 — forked from billti/arm64-on-Win10.md
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help