Skip to content

Instantly share code, notes, and snippets.

@damonYuan
damonYuan / Activate Office 2019 for macOS VoL.md
Last active March 2, 2022 04:58 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@damonYuan
damonYuan / double-fork-daemon.py
Created February 9, 2020 15:14 — forked from TheWaWaR/double-fork-daemon.py
UNIX double-fork magic to let process be daemon
def spawnDaemon(func):
# do the UNIX double-fork magic, see Stevens' "Advanced
# Programming in the UNIX Environment" for details (ISBN 0201563177)
try:
pid = os.fork()
if pid > 0:
# parent process, return and keep running
return
except OSError, e:
print >>sys.stderr, "fork #1 failed: %d (%s)" % (e.errno, e.strerror)
@damonYuan
damonYuan / delete_git_submodule.md
Created February 2, 2020 11:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
```
| No ENTRYPOINT | ENTRYPOINT entry | ENTRYPOINT ["entry"] |
------------+-----------------+------------------------------ ---+-----------------------|
No CMD | <error> | /bin/sh -c entry | entry |
CMD cmd | /bin/sh -c cmd | /bin/sh -c entry /bin/sh -c cmd | entry /bin/sh -c cmd |
CMD ["cmd"] | cmd | /bin/sh -c entry cmd | entry cmd |
------------------------------------------------------------------------------------------
```
@damonYuan
damonYuan / Jenkinsfile.groovy
Created December 14, 2018 08:51 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
#
# Set the build number to the current git commit count.
# If we're using the Dev scheme, then we'll suffix the build
# number with the current branch name, to make collisions
# far less likely across feature branches.
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/
#
git=`sh /etc/profile; which git`
appBuild=`"$git" rev-list --all |wc -l`
if [ $CONFIGURATION = "Debug" ]; then
@damonYuan
damonYuan / ssl_puma.sh
Created January 10, 2018 03:07 — forked from BrianSigafoos/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@damonYuan
damonYuan / build-checkstyle.gradle
Last active August 28, 2017 04:16 — forked from nickwph/build-checkstyle.gradle
Android checkstyle gradle script
/**
* Created by Nicholas Wong <nickwph@gmail.com>.
* Github Gist: https://gist.github.com/nickwph/de0dd805e29fe3bcba476b6126459259
* Gradle build file to set up variables for checkstyle.
*/
apply plugin: 'checkstyle'
checkstyle {
configFile file('checkstyle-config.xml')
showViolations true
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@damonYuan
damonYuan / Enhance.js
Created May 18, 2016 21:38 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {