Skip to content

Instantly share code, notes, and snippets.

View mindeng's full-sized avatar
🎯
Focusing

Min Deng mindeng

🎯
Focusing
View GitHub Profile
@mindeng
mindeng / extract-urls.js
Last active December 3, 2018 08:38
extract urls from web page (you can run it from chrome console or code snippets)
// xpath of items
var jd_items_in_cart = '//*/div[1]/div[2]/div/div[2]/div[1]/a';
var items = document.evaluate(jd_items_in_cart, document, null, XPathResult.ANY_TYPE, null);
while(item=items.iterateNext()) {
console.log(item.href);
}
@mindeng
mindeng / reuse-widget.dart
Created July 21, 2019 08:09
Reuse widgets in Flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: HelloWidget(),
package main
// https://tour.go-zh.org/concurrency/8
import "golang.org/x/tour/tree"
import "fmt"
/*
type Tree struct {
Left *Tree
@mindeng
mindeng / README.md
Created January 9, 2021 13:41 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@mindeng
mindeng / socks5_proxy.go
Created June 6, 2021 11:35 — forked from felix021/socks5_proxy.go
Minimal socks5 proxy implementation in Golang
package main
import (
"encoding/binary"
"errors"
"fmt"
"io"
"net"
)
@mindeng
mindeng / deps.py
Created May 10, 2022 09:54 — forked from weixinfree/deps.py
快速的分析一个复杂模块的依赖关系 并且 可视化
#! /usr/bin/env python3
"""
Prerequirements:
1. brew install graphviz
2. pip3 install fire
3. pip3 install simpletemplate
Usage:
deps [path to code]
@mindeng
mindeng / gpg-ssh-setup.md
Created September 4, 2022 13:50 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.