Skip to content

Instantly share code, notes, and snippets.

View zacker330's full-sized avatar
🌧️

Jack Zhai zacker330

🌧️
View GitHub Profile
@zacker330
zacker330 / sh.sh
Created March 16, 2020 02:06
[gitlab拒绝强制push]
gitlab disable force push
就有,写个 hook 就行
https://stackoverflow.com/questions/45374801/is-it-possible-in-gitlab-to-disable-force-push-for-all-branches-but-allow-to-de
@zacker330
zacker330 / main.go
Created July 12, 2019 02:04
main.go
package main
import (
"context" // Use "golang.org/x/net/context" for Golang version <= 1.6
"flag"
"net/http"
"github.com/golang/glog"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"google.golang.org/grpc"
@zacker330
zacker330 / gg.groovy
Last active June 1, 2022 19:50
[Jenkins自动安装插件] #jenkins
import jenkins.model.*
def installed = false
def initialized = false
def pluginParameter="ldap matrix-auth ssh-credentials"
def plugins = pluginParameter.split()
def instance = Jenkins.getInstance()
def pm = instance.getPluginManager()
def uc = instance.getUpdateCenter()
plugins.each {
if (!pm.getPlugin(it)) {
@zacker330
zacker330 / electron-sqlite3.md
Created April 1, 2019 03:18 — forked from jonataswalker/electron-sqlite3.md
Electron SQLite3 Integration

Electron SQLite3 Integration

When trying to use the node-sqlite3 module in Electron I got the error:

Error: Cannot find module '/path/to/my/application/node_modules/sqlite3/lib/binding/electron-v1.4-linux-x64/node_sqlite3.node'

Using Ubuntu 16.04 with Node 7.1.0 and Electron 1.4.12.

I read the following:

@zacker330
zacker330 / .git-commit-template.txt
Created March 25, 2019 00:15 — forked from jmaxhu/.git-commit-template.txt
一份建议的git commit模板
# <类型>: (类型的值见下面描述) <主题> (最多50个字)
# 解释为什么要做这些改动
# |<---- 请限制每行最多72个字 ---->|
# 提供相关文章和其它资源的链接和关键字
# 例如: Github issue #23
# --- 提交 结束 ---
# 类型值包含
@zacker330
zacker330 / f.ftl
Created March 19, 2019 08:57
[freemarker 对空list进行判断] #freemarker
<#if (paramList?? && (paramList?size > 0))>
@zacker330
zacker330 / echo.py
Created March 17, 2019 10:50
[echo http server] #python
import socket
def listen():
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
connection.bind(('0.0.0.0', 5555))
connection.listen(10)
while True:
current_connection, address = connection.accept()
while True:
@zacker330
zacker330 / c.java
Created January 16, 2019 11:14
[打印所有的bean] #springboot
ConfigurableApplicationContext applicationContext = SpringApplication.run(WebServer.class, args);
String[] beanNames = applicationContext.getBeanDefinitionNames();
System.out.println("" + beanNames.length);
for (String bn : beanNames) {
System.out.println("zhaizj:" + bn);
}
@zacker330
zacker330 / readme.md
Created January 13, 2019 22:50
[macos mysql安装] #mysql #installation

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@zacker330
zacker330 / gist:de85eb0ac2b16db39e22b7ce620e88d2
Created January 3, 2019 12:02 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {