Skip to content

Instantly share code, notes, and snippets.

View WindzCUHK's full-sized avatar
💭
Code for pizza. Any job?

Windz WindzCUHK

💭
Code for pizza. Any job?
  • CUHK
  • Hong Kong
View GitHub Profile
@WindzCUHK
WindzCUHK / simple-https-client.go
Created June 20, 2019 09:19
HTTPS client sends client certificate
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"errors"
"fmt"

add copy button to code block

<script type = 'text/javascript'>

/* add copy CSS */
var sheet = document.styleSheets[0];
var buttonStyle = [
  'content: "";',
  'position: absolute;',
  'top: 50%;',
@WindzCUHK
WindzCUHK / JS-AIO.md
Last active September 25, 2017 02:54

js generator

/*|================================================================|*/
/*|                          js generator                          |*/
/*|================================================================|*/
const ooo = (function* xxx(v) {
	const abc = 1;
	while (1) {
		yield abc + v;
@WindzCUHK
WindzCUHK / template.sh
Last active September 11, 2017 03:11
bash script
#!/bin/sh
# exit when there is a non-zero exit code
set -e
# default pipeline return status = exit code of last command
# set this option: return status = last (rightmost) command with non-zero exit code, or 0 if all commands exit with 0
set -o pipefail
# console color

largest folders

du -hsx * | sort -rh | head -10 du -sx * | sort -rn | head -10

largest file

find /path/to/dir/ -type f -printf '%s %p\n'| sort -nr | head -10

disk usage

df -Th

@WindzCUHK
WindzCUHK / EqualsUtility.java
Created May 16, 2017 02:22
JAVA code snippets
public class EqualsUtility {
/**
* <ol>
* <li>a == b || null == null</li>
* <li>exclude a == null</li>
* <li>check runtime class equals</li>
* <li>check object properties equal</li>
* </ol>
* @param a

Files

  • force copy recursive
     @echo off
    
     set source="C:\Users\windz.fan\Desktop\reporter-api\reporter-api-lib"
     set d1="D:\Temp\=temp=\reporter-api-lib"
     set d2="C:\Users\windz.fan\Desktop\heartbeat-agent\reporter-api-lib"
     set d3="C:\Users\windz.fan\Desktop\server-agent\reporter-api-lib"
     set d4="C:\Users\windz.fan\Desktop\price-agent\reporter-api-lib"
@WindzCUHK
WindzCUHK / Windows Server 2016 Customization.md
Last active May 24, 2020 13:54
Customization my windows server 2016

File explorer

Disable thumb.db

  • stop creation
     Windows Registry Editor Version 5.00
    
     [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
     “DisableThumbsDBOnNetworkFolders”=dword:00000001
     [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
     "NoThumbnailCache"=dword:00000001