Skip to content

Instantly share code, notes, and snippets.

View xinpingwang's full-sized avatar
:octocat:

小新 xinpingwang

:octocat:
View GitHub Profile
@xinpingwang
xinpingwang / docker-for-mac.md
Created May 29, 2022 09:10 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@xinpingwang
xinpingwang / pom.xml
Last active February 12, 2020 10:55
ali p3c code style check config for pmd
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.8</version>
<configuration>
<printFailingErrors>true</printFailingErrors>
<verbose>true</verbose>
<rulesets>
<ruleset>rulesets/java/ali-comment.xml</ruleset>
<ruleset>rulesets/java/ali-concurrent.xml</ruleset>
@xinpingwang
xinpingwang / ArgumentParser.swift
Created December 2, 2019 03:18
swift argument parser
// from https://github.com/apple/swift-package-manager/blob/cce860c70c3d96d6b21d5f56c06a7edb53996d90/Sources/TSCUtility/ArgumentParser.swift#L1-L1137
/*
This source file is part of the Swift.org open source project
Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
@xinpingwang
xinpingwang / google-translate-api-key
Last active November 26, 2019 14:49
generate google translate api key
/**
* Last update: 2016/06/26
* https://translate.google.com/translate/releases/twsfe_w_20160620_RC00/r/js/desktop_module_main.js
*
* Everything between 'BEGIN' and 'END' was copied from the url above.
*/
var got = require('got');
var Configstore = require('configstore');